Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
305 changes: 0 additions & 305 deletions docs/kiva/agg/interface.txt

This file was deleted.

72 changes: 17 additions & 55 deletions enable/savage/svg/backends/wx/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,15 @@ def convert_stop(stop):
)
return offset, color

if wx.VERSION[:2] > (2, 9):
# wxPython 2.9+ supports a collection of stops
wx_stops = wx.GraphicsGradientStops()
for stop in stops:
offset, color = convert_stop(stop)
wx_stops.Add(color, offset)

wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateLinearGradientBrush(
x1, y1, x2, y2, wx_stops
)

else:
if len(stops) > 2:
msg = ("wxPython 2.8 only supports 2 gradient stops, but %d "
"were specified")
warnings.warn(msg % len(stops))

start_offset, start_color = convert_stop(stops[0])
end_offset, end_color = convert_stop(stops[1])

wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateLinearGradientBrush(
x1, y1, x2, y2, start_color, end_color
)
wx_stops = wx.GraphicsGradientStops()
for stop in stops:
offset, color = convert_stop(stop)
wx_stops.Add(color, offset)

wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateLinearGradientBrush(
x1, y1, x2, y2, wx_stops
)

@staticmethod
def createRadialGradientBrush(cx, cy, r, stops, fx=None, fy=None,
Expand All @@ -136,37 +120,15 @@ def convert_stop(stop):
)
return offset, color

if wx.VERSION[:2] > (2, 9):
# wxPython 2.9+ supports a collection of stops
wx_stops = wx.GraphicsGradientStops()
for stop in stops:
offset, color = convert_stop(stop)
wx_stops.Add(color, offset)

wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateRadialGradientBrush(
fx, fy, cx, cy, r, wx_stops
)

else:

if len(stops) > 2:
msg = ("wxPython 2.8 only supports 2 gradient stops, but %d "
"were specified")
warnings.warn(msg % len(stops))
wx_stops = wx.GraphicsGradientStops()
for stop in stops:
offset, color = convert_stop(stop)
wx_stops.Add(color, offset)

start_offset, start_color = convert_stop(stops[0])
end_offset, end_color = convert_stop(stops[-1])

if fx is None:
fx = cx
if fy is None:
fy = cy

wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateRadialGradientBrush(
fx, fy, cx, cy, r, start_color, end_color
)
wx_renderer = wx.GraphicsRenderer.GetDefaultRenderer()
return wx_renderer.CreateRadialGradientBrush(
fx, fy, cx, cy, r, wx_stops
)

@staticmethod
def fillPath(*args):
Expand Down
Loading