graphics/GraphicCommons.py
changeset 386 2049a2bd8017
parent 384 ed27a676d5c9
child 395 d432eae889ed
--- a/graphics/GraphicCommons.py	Fri Jul 24 11:13:03 2009 +0200
+++ b/graphics/GraphicCommons.py	Fri Jul 24 11:18:07 2009 +0200
@@ -2777,21 +2777,22 @@
                 wordwidth, wordheight = dc.GetTextExtent(test)
                 if y + wordheight > self.Pos.y + self.Size[1] - 10:
                     break
-                if wordwidth < self.Size[0] - 20 and i < len(words) - 1:
-                    linetext = test
-                    first = False
+                if wordwidth < self.Size[0] - 20:
+                    if i < len(words) - 1:
+                        linetext = test
+                        first = False
+                    else:
+                        dc.DrawText(test, self.Pos.x + 10, y)
+                        y += wordheight + 5
                 else:
-                    if wordwidth < self.Size[0] - 20 and i == len(words) - 1:
-                        dc.DrawText(test, self.Pos.x + 10, y)
+                    dc.DrawText(linetext, self.Pos.x + 10, y)
+                    if i == len(words) - 1:
+                        y += wordheight + 5
+                        if y + wordheight > self.Pos.y + self.Size[1] - 10:
+                            break
+                        dc.DrawText(word, self.Pos.x + 10, y)
                     else:
-                        dc.DrawText(linetext, self.Pos.x + 10, y)
-                        if i == len(words) - 1:
-                            y += wordheight + 5
-                            if y + wordheight > self.Pos.y + self.Size[1] - 10:
-                                break
-                            dc.DrawText(word, self.Pos.x + 10, y)
-                        else:
-                            linetext = word
+                        linetext = word
                     y += wordheight + 5
             if y + wordheight > self.Pos.y + self.Size[1] - 10:
                 break