Skip to content

Commit

Permalink
remove old deprecated drawing methods (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronayres35 authored May 18, 2021
1 parent 21c299e commit 906fe9d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
8 changes: 0 additions & 8 deletions enable/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,6 @@ def _do_layout(self):
"""
pass

def _draw_component(self, gc, view_bounds=None, mode="normal"):
""" Renders the component.
Subclasses must implement this method to actually render themselves.
Note: This method is used only by the "old" drawing calls.
"""
pass

def _draw_selection(self, gc, view_bounds=None, mode="normal"):
""" Renders a selected subset of a component's data.
Expand Down
52 changes: 0 additions & 52 deletions enable/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,6 @@ def _component_position_changed(self, component):
if self.auto_size:
self.compact()

# ------------------------------------------------------------------------
# Deprecated interface
# ------------------------------------------------------------------------

def _draw_overlays(self, gc, view_bounds=None, mode="normal"):
""" Method for backward compatability with old drawing scheme.
"""
warnings.warn("Containter._draw_overlays is deprecated.")
for component in self.overlays:
component.overlay(component, gc, view_bounds, mode)

# ------------------------------------------------------------------------
# Property setters & getters
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -583,44 +572,3 @@ def __components_items_changed(self, event):
def __components_changed(self, event):
self._layout_needed = True
self.invalidate_draw()

# -------------------------------------------------------------------------
# Old / deprecated draw methods; here for backwards compatibility
# -------------------------------------------------------------------------

def _draw_component(self, gc, view_bounds=None, mode="normal"):
""" Draws the component.
This method is preserved for backwards compatibility. Overrides
the implementation in Component.
"""
with gc:
gc.set_antialias(False)

self._draw_container(gc, mode)
self._draw_background(gc, view_bounds, mode)
self._draw_underlay(gc, view_bounds, mode)
self._draw_children(
gc, view_bounds, mode
) # This was children_draw_mode
self._draw_overlays(gc, view_bounds, mode)

def _draw_children(self, gc, view_bounds=None, mode="normal"):

new_bounds = self._transform_view_bounds(view_bounds)
if new_bounds == empty_rectangle:
return

with gc:
gc.set_antialias(False)
gc.translate_ctm(*self.position)
for component in self.components:
if new_bounds:
tmp = intersect_bounds(
component.outer_position + component.outer_bounds,
new_bounds,
)
if tmp == empty_rectangle:
continue
with gc:
component.draw(gc, new_bounds, mode)

0 comments on commit 906fe9d

Please sign in to comment.