* Use pen += FTPoint(a, 0) constructs instead of pen.X(pen.X() + a), it's more object-oriented.
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
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index e5e3d76..571db86 100644
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -276,7 +276,7 @@ template <typename T>
inline void FTFont::RenderI(const T* string)
{
const T* c = string;
- pen.X(0); pen.Y(0);
+ pen = FTPoint(0., 0.);
while(*c)
{
diff --git a/src/FTSimpleLayout.cpp b/src/FTSimpleLayout.cpp
index 2a27035..e72973f 100644
--- a/src/FTSimpleLayout.cpp
+++ b/src/FTSimpleLayout.cpp
@@ -82,8 +82,7 @@ void FTSimpleLayout::BBox(const wchar_t *string, float& llx, float& lly,
template <typename T>
inline void FTSimpleLayout::RenderI(const T *string)
{
- pen.X(0.0f);
- pen.Y(0.0f);
+ pen = FTPoint(0.0f, 0.0f);
WrapText(string, NULL);
}
@@ -173,7 +172,7 @@ inline void FTSimpleLayout::WrapTextI(const T *buf, FTBBox *bounds)
// Store the start of the next line
lineStart = breakIdx + 1;
// TODO: Is Height() the right value here?
- pen.Y(pen.Y() - GetCharSize(currentFont).Height() * lineSpacing);
+ pen -= FTPoint(0, GetCharSize(currentFont).Height() * lineSpacing);
// The current width is the width since the last break
nextStart = wordLength + advance;
wordLength += advance;
@@ -334,7 +333,7 @@ inline void FTSimpleLayout::RenderSpaceI(const T *string, const int start,
// inside it
if((i > start) && !isspace(string[i]) && isspace(string[i - 1]))
{
- pen.X(pen.X() + space);
+ pen += FTPoint(space, 0);
}
DoRender(currentFont, string[i], string[i + 1]);