]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for ogl.FORMAT_SIZE_TO_CONTENTS
authorRobin Dunn <robin@alldunn.com>
Fri, 10 Sep 2004 19:54:05 +0000 (19:54 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 10 Sep 2004 19:54:05 +0000 (19:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/lib/ogl/_basic.py
wxPython/wx/lib/ogl/_oglmisc.py

index de7b94a2b08cd98b0208eb26fab46a20a7c226f1..a8abcd5f5418a9018b2b58abb43b866dcce13439 100644 (file)
@@ -521,7 +521,7 @@ class Shape(ShapeEvtHandler):
         # Don't try to resize an object with more than one image (this
         # case should be dealt with by overriden handlers)
         if (region.GetFormatMode() & FORMAT_SIZE_TO_CONTENTS) and \
-           region.GetFormattedText().GetCount() and \
+           len(region.GetFormattedText()) and \
            len(self._regions) == 1 and \
            not Shape.GraphicsInSizeToContents:
 
index cca574608dc9ad8777d38909c1b8fa0a6233fa3f..ad2640bc18839991ddb4edb408e2fbbf5315aa39 100644 (file)
@@ -153,7 +153,7 @@ def GetCentredTextExtent(dc, text_list, xpos = 0, ypos = 0, width = 0, height =
 
     max_width = 0
     for line in text_list:
-        current_width, char_height = dc.GetTextExtent(line)
+        current_width, char_height = dc.GetTextExtent(line.GetText())
         if current_width > max_width:
             max_width = current_width