* bezier.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: bezier.cpp,v 1.4 2004/03/02 21:45:15 ipkiss Exp $
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#include <vlc/vlc.h>
#include "bezier.hpp"
#include <math.h>
+#ifndef HAVE_LRINTF
+# define lrintf(a) (int)rint(a)
+#endif
Bezier::Bezier( intf_thread_t *p_intf, const vector<float> &rAbscissas,
const vector<float> &rOrdinates, Flag_t flag )
int width = 0;
for( int i = 0; i < m_nbPoints; i++ )
{
- if( m_leftVect[i] > width )
+ if( m_leftVect[i] >= width )
{
- width = m_leftVect[i];
+ width = m_leftVect[i] + 1;
}
}
return width;
int height = 0;
for( int i = 0; i < m_nbPoints; i++ )
{
- if( m_topVect[i] > height )
+ if( m_topVect[i] >= height )
{
- height = m_topVect[i];
+ height = m_topVect[i] + 1;
}
}
return height;
yPos += m_pty[i] * coeff;
}
- // Float cast to avoid strange truncatures
- // XXX: not very nice...
- x = (int)(float)xPos;
- y = (int)(float)yPos;
+ x = lrintf(xPos);
+ y = lrintf(yPos);
}
else
return 1;
}
-