Fix bug with Function Blocks input and output position on Windows
authorlaurent
Tue, 19 Apr 2011 17:09:03 +0200
changeset 532 63e141705d19
parent 531 193505b8ddcf
child 533 7081b52a8a2d
Fix bug with Function Blocks input and output position on Windows
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Tue Apr 19 15:07:57 2011 +0200
+++ b/graphics/GraphicCommons.py	Tue Apr 19 17:09:03 2011 +0200
@@ -1363,8 +1363,7 @@
     # Changes the connector name size
     def RefreshNameSize(self):
         if self.Name != "":
-            dc = wx.ClientDC(self.ParentBlock.Parent)
-            self.NameSize = dc.GetTextExtent(self.Name)
+            self.NameSize = self.ParentBlock.Parent.GetTextExtent(self.Name)
         else:
             self.NameSize = 0, 0
     
@@ -1703,10 +1702,10 @@
             width, height = self.ValueSize
             if self.BoundingBox[2] > width * 4 or self.BoundingBox[3] > height * 4:
                 x = self.Points[0].x + width * self.StartPoint[1][0] / 2
-                y = self.Points[0].y + (height * self.StartPoint[1][1] - 1)
+                y = self.Points[0].y + height * (self.StartPoint[1][1] - 1)
                 rect = rect.Union(wx.Rect(x, y, width, height))
                 x = self.Points[-1].x + width * self.EndPoint[1][0] / 2
-                y = self.Points[-1].y + (height * self.EndPoint[1][1] - 1)
+                y = self.Points[-1].y + height * (self.EndPoint[1][1] - 1)
                 rect = rect.Union(wx.Rect(x, y, width, height))
             else:
                 middle = len(self.Segments) / 2 + len(self.Segments) % 2 - 1