def FormatText(self, dc, s, i):
"""Format a text string according to the region size, adding
def FormatText(self, dc, s, i):
"""Format a text string according to the region size, adding
def SetEnds(self, x1, y1, x2, y2):
"""Set the end positions of the line."""
def SetEnds(self, x1, y1, x2, y2):
"""Set the end positions of the line."""
- # Find centre point
- first_point = self._lineControlPoints[0]
- last_point = self._lineControlPoints[-1]
-
- first_point[0] = x1
- first_point[1] = y1
- last_point[0] = x2
- last_point[1] = y2
+ self._lineControlPoints[0] = x1, y1
+ self._lineControlPoints[-1] = x2, y2
# if attachment mode is ON
if self._from == self._to and self._from.GetAttachmentMode() != ATTACHMENT_MODE_NONE and moveControlPoints and self._lineControlPoints and not (x_offset == 0 and y_offset == 0):
for point in self._lineControlPoints[1:-1]:
# if attachment mode is ON
if self._from == self._to and self._from.GetAttachmentMode() != ATTACHMENT_MODE_NONE and moveControlPoints and self._lineControlPoints and not (x_offset == 0 and y_offset == 0):
for point in self._lineControlPoints[1:-1]:
if sys.platform[:3] == "win":
# For some reason, last point isn't drawn under Windows
pt = points[-1]
if sys.platform[:3] == "win":
# For some reason, last point isn't drawn under Windows
pt = points[-1]
# Problem with pen - if not a solid pen, does strange things
# to the arrowhead. So make (get) a new pen that's solid.
# Problem with pen - if not a solid pen, does strange things
# to the arrowhead. So make (get) a new pen that's solid.