Minor change to bbox functions
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
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index d2a0930..b52a31c 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -125,7 +125,6 @@ float FTFont::Descender() const
void FTFont::BBox( const char* string,
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
{
- const unsigned char* c = (unsigned char*)string;
llx = lly = llz = urx = ury = urz = 0.0f;
if( !*string)
@@ -133,6 +132,8 @@ void FTFont::BBox( const char* string,
return;
}
+ const unsigned char* c = (unsigned char*)string;
+
FTBBox bbox;
while( *c)
@@ -167,7 +168,6 @@ void FTFont::BBox( const char* string,
void FTFont::BBox( const wchar_t* string,
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
{
- const wchar_t* c = string;
llx = lly = llz = urx = ury = urz = 0.0f;
if( !*string)
@@ -175,6 +175,7 @@ void FTFont::BBox( const wchar_t* string,
return;
}
+ const wchar_t* c = string;
FTBBox bbox;
while( *c)