projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied patch [ 1407318 ] bitmap clipping / transparency mask (X11 port)
[wxWidgets.git]
/
wxPython
/
wx
/
lib
/
ogl
/
_lines.py
diff --git
a/wxPython/wx/lib/ogl/_lines.py
b/wxPython/wx/lib/ogl/_lines.py
index 6b6e4cf59be79d7c95e5edbb81259989f18e1d25..d316630fbbe58d8dd62e0e8406b82a746c38f06c 100644
(file)
--- a/
wxPython/wx/lib/ogl/_lines.py
+++ b/
wxPython/wx/lib/ogl/_lines.py
@@
-14,7
+14,7
@@
import sys
import math
import sys
import math
-from _basic import Shape, ShapeRegion, ControlPoint, RectangleShape
+from _basic import Shape, ShapeRegion,
ShapeTextLine,
ControlPoint, RectangleShape
from _oglmisc import *
# Line alignment flags
from _oglmisc import *
# Line alignment flags
@@
-298,16
+298,19
@@
class LineShape(Shape):
# the middle points to something other than (-999, -999)
self._initialised = False
# the middle points to something other than (-999, -999)
self._initialised = False
- def InsertLineControlPoint(self, dc = None):
- """Insert a control point at an
arbitrary
position."""
+ def InsertLineControlPoint(self, dc = None
, point = None
):
+ """Insert a control point at an
optional given
position."""
if dc:
self.Erase(dc)
if dc:
self.Erase(dc)
- last_point = self._lineControlPoints[-1]
- second_last_point = self._lineControlPoints[-2]
+ if point:
+ line_x, line_y = point
+ else:
+ last_point = self._lineControlPoints[-1]
+ second_last_point = self._lineControlPoints[-2]
- line_x = (last_point[0] + second_last_point[0]) / 2.0
- line_y = (last_point[1] + second_last_point[1]) / 2.0
+
line_x = (last_point[0] + second_last_point[0]) / 2.0
+
line_y = (last_point[1] + second_last_point[1]) / 2.0
point = wx.RealPoint(line_x, line_y)
self._lineControlPoints.insert(len(self._lineControlPoints)-1, point)
point = wx.RealPoint(line_x, line_y)
self._lineControlPoints.insert(len(self._lineControlPoints)-1, point)