Made render() arg const. delete contourList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/src/FTVectorGlyph.cpp b/src/FTVectorGlyph.cpp
index 98a35c0..17c6246 100755
--- a/src/FTVectorGlyph.cpp
+++ b/src/FTVectorGlyph.cpp
@@ -12,7 +12,8 @@ FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph, int gi)
numPoints(0),
numContours(0),
contourLength(0),
- data(0)
+ data(0),
+ glList(0)
{
if( glyph->format == ft_glyph_format_outline)
{
@@ -38,7 +39,7 @@ FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph, int gi)
delete vectoriser;
- if ( ( numContours < 1) || ( numPoints < 1))
+ if ( ( numContours < 1) || ( numPoints < 3)) // check this
return;
glList = glGenLists(1);
@@ -64,10 +65,11 @@ FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph, int gi)
FTVectorGlyph::~FTVectorGlyph()
{
delete [] data;
+ delete [] contourLength;
}
-float FTVectorGlyph::Render( FT_Vector& pen)
+float FTVectorGlyph::Render( const FT_Vector& pen)
{
glTranslatef( pen.x, pen.y, 0);
glCallList( glList);
diff --git a/src/FTVectorGlyph.h b/src/FTVectorGlyph.h
index 88fe143..3c47435 100755
--- a/src/FTVectorGlyph.h
+++ b/src/FTVectorGlyph.h
@@ -15,7 +15,7 @@ class FTVectorGlyph : public FTGlyph
// methods
FTVectorGlyph( FT_Glyph glyph, int glyphIndex);
virtual ~FTVectorGlyph();
- virtual float Render( FT_Vector& pen);
+ virtual float Render( const FT_Vector& pen);
// attributes