Commit 9f770d581a420fd50de7de3b59a10062e51a2979

sammy 2008-04-17T13:38:28

* Use pen += FTPoint(a, 0) constructs instead of pen.X(pen.X() + a), it's more object-oriented.

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]);