X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79609e6f24dbd9382a8351d10d436c6e115bda2e..b14b1312ace5e4056f68951679241bdd53f1f987:/wxPython/wx/lib/ogl/_drawn.py diff --git a/wxPython/wx/lib/ogl/_drawn.py b/wxPython/wx/lib/ogl/_drawn.py index 550137f3ee..7f2c1d9831 100644 --- a/wxPython/wx/lib/ogl/_drawn.py +++ b/wxPython/wx/lib/ogl/_drawn.py @@ -61,6 +61,9 @@ class DrawOp(object): def Translate(self, x, y): pass + + def Rotate(self, x, y, theta, sinTheta, cosTheta): + pass class OpSetGDI(DrawOp): """Set font, brush, text colour.""" @@ -87,7 +90,7 @@ class OpSetGDI(DrawOp): if self._gdiIndex in self._image._outlineColours: # Need to construct a brush to match the outline pen's colour if self._image._outlinePen: - br = wx.TheBrushList.FindOrCreateBrush(self._image._outlinePen, wx.SOLID) + br = wx.Brush(self._image._outlinePen, wx.SOLID) if br: dc.SetBrush(br) elif self._gdiIndex in self._image._fillColours: @@ -163,7 +166,7 @@ class OpDraw(DrawOp): elif self._op == DRAWOP_DRAW_ARC: dc.DrawArc(self._x2 + xoffset, self._y2 + yoffset, self._x3 + xoffset, self._y3 + yoffset, self._x1 + xoffset, self._y1 + yoffset) elif self._op == DRAWOP_DRAW_ELLIPTIC_ARC: - dc.DrawEllipticArc(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2, self._x3 * 360 / (2 * math.pi), self.y3 * 360 / (2 * math.pi)) + dc.DrawEllipticArc(self._x1 + xoffset, self._y1 + yoffset, self._x2, self._y2, self._x3 * 360 / (2 * math.pi), self._y3 * 360 / (2 * math.pi)) elif self._op == DRAWOP_DRAW_POINT: dc.DrawPoint(self._x1 + xoffset, self._y1 + yoffset) elif self._op == DRAWOP_DRAW_TEXT: @@ -263,7 +266,7 @@ class OpPolyDraw(DrawOp): def Scale(self, scaleX, scaleY): for i in range(self._noPoints): - self._points[i] = self._points[i][0] * scaleX, self._points[i][1] * scaleY + self._points[i] = wx.Point(self._points[i][0] * scaleX, self._points[i][1] * scaleY) def Translate(self, x, y): for i in range(self._noPoints): @@ -275,8 +278,7 @@ class OpPolyDraw(DrawOp): x1 = self._points[i][0] y1 = self._points[i][1] - self._points[i][0] = x1 * cosTheta - y1 * sinTheta + x * (1 - cosTheta) + y * sinTheta - self._points[i][1] = x1 * sinTheta + y1 * cosTheta + y * (1 - cosTheta) + x * sinTheta + self._points[i] = x1 * cosTheta - y1 * sinTheta + x * (1 - cosTheta) + y * sinTheta, x1 * sinTheta + y1 * cosTheta + y * (1 - cosTheta) + x * sinTheta def OnDrawOutline(self, dc, x, y, w, h, oldW, oldH): dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -394,8 +396,8 @@ class PseudoMetaFile(object): if theta1 == 0: return - cosTheta = cos(theta1) - sinTheta = sin(theta1) + cosTheta = math.cos(theta1) + sinTheta = math.sin(theta1) for op in self._ops: op.Rotate(x, y, theta, sinTheta, cosTheta) @@ -710,7 +712,7 @@ class DrawnShape(RectangleShape): # of metafiles. def DetermineMetaFile(self, rotation): tolerance = 0.0001 - angles = [0.0, math.pi / 2, math.pi, 3 * pi / 2] + angles = [0.0, math.pi / 2, math.pi, 3 * math.pi / 2] whichMetaFile = 0