mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Some tweaks for PenInfo and GraphicsPenInfo wrappers
This commit is contained in:
@@ -197,12 +197,14 @@ class GraphicsPen(GraphicsObject):
|
||||
|
||||
@staticmethod
|
||||
def CreateFromPen(pen):
|
||||
"""Convert a :class:`wx.Pen` to a ``GraphicsPen``"""
|
||||
assert isinstance(pen, wx.Pen)
|
||||
p = GraphicsPen(pen.Colour, pen.Width, pen.Style)
|
||||
p._cap = pen.Cap
|
||||
p._dashes = pen.Dashes
|
||||
p._join = pen.Join
|
||||
"""Convert a :class:`wx.Pen` or :class:`wx.GraphicsPenInfo` to a ``GraphicsPen``"""
|
||||
assert isinstance(pen, (wx.Pen, wx.GraphicsPenInfo))
|
||||
p = GraphicsPen(pen.GetColour(), pen.GetWidth(), pen.GetStyle())
|
||||
p._cap = pen.GetCap()
|
||||
p._join = pen.GetJoin()
|
||||
if isinstance(pen, wx.Pen):
|
||||
# TODO: GraphicsPenInfo still needs Dashes support added.
|
||||
p._dashes = pen.GetDashes()
|
||||
return p
|
||||
|
||||
|
||||
@@ -1330,7 +1332,7 @@ class GraphicsContext(GraphicsObject):
|
||||
|
||||
def CreatePen(self, pen):
|
||||
"""
|
||||
Create a new pen from a wx.Pen.
|
||||
Create a new pen from a wx.Pen or a wx.GraphicsPenInfo.
|
||||
"""
|
||||
return GraphicsPen.CreateFromPen(pen)
|
||||
|
||||
@@ -1824,6 +1826,10 @@ class GraphicsContext(GraphicsObject):
|
||||
self._context.paint_with_alpha(opacity)
|
||||
|
||||
|
||||
def Flush(self):
|
||||
pass
|
||||
|
||||
|
||||
def GetSize(self):
|
||||
return (self._width, self._height)
|
||||
Size = property(GetSize)
|
||||
|
||||
Reference in New Issue
Block a user