]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes for bug #1031151 and #1031239
authorRobin Dunn <robin@alldunn.com>
Thu, 23 Sep 2004 00:43:47 +0000 (00:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 23 Sep 2004 00:43:47 +0000 (00:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 74f5b78d742e85333c72085576cb50ed66191416..c20e9ac2ea39a82a19ea117c3796eb1e1a6cfcab 100644 (file)
@@ -345,7 +345,7 @@ class LineShape(Shape):
                     else:
                         y2 = first_point[1]
                         y1 = last_point[1]
-                    self._lineControlPoints[i] = (x2 - x1) / 2.0 + x1, (y2 - y1) / 2.0 + y1
+                    self._lineControlPoints[i] = wx.RealPoint((x2 - x1) / 2.0 + x1, (y2 - y1) / 2.0 + y1)
                     
     def FormatText(self, dc, s, i):
         """Format a text string according to the region size, adding
@@ -490,8 +490,8 @@ class LineShape(Shape):
 
     def SetEnds(self, x1, y1, x2, y2):
         """Set the end positions of the line."""
-        self._lineControlPoints[0] = x1, y1
-        self._lineControlPoints[-1] = x2, y2
+        self._lineControlPoints[0] = wx.RealPoint(x1, y1)
+        self._lineControlPoints[-1] = wx.RealPoint(x2, y2)
 
         # Find centre point
         self._xpos = (x1 + x2) / 2.0
@@ -911,9 +911,6 @@ class LineShape(Shape):
         # manually if necessary
         end_x, end_y, other_end_x, other_end_y = self.FindLineEndPoints()
 
-        first = self._lineControlPoints[0]
-        last = self._lineControlPoints[-1]
-
         oldX, oldY = self._xpos, self._ypos
 
         self.SetEnds(end_x, end_y, other_end_x, other_end_y)
index ad2640bc18839991ddb4edb408e2fbbf5315aa39..db2185c8322d72098868b0a46285f10bd52d0406 100644 (file)
@@ -333,7 +333,7 @@ def GraphicsStraightenLine(point1, point2):
     elif abs(float(dy) / dx) > 1:
         point2[0] = point1[0]
     else:
-        point2[1] = point1[0]
+        point2[1] = point1[1]