|
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_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) |
These seem to have been introduced in the commit - d8fc3d1. This commit seems to have changed the DEFAULT_DRAWING_ORDER to what we are mostly familiar with - "background", "mainlayer", "border", "overlay". _draw_component seems to have been introduced as a backwards compatibility measure.
As you can see from here -
|
for layer in self.draw_order: |
|
if layer != "overlay": |
|
self._dispatch_draw(layer, bb, view_bounds, mode) |
|
|
|
self._backbuffer = bb |
|
self.draw_valid = True |
|
|
|
# Blit the backbuffer and then draw the overlay on top |
|
gc.draw_image(self._backbuffer, (x, y, width, height)) |
|
self._dispatch_draw("overlay", gc, view_bounds, mode) |
|
else: |
|
for layer in self.draw_order: |
|
self._dispatch_draw(layer, gc, view_bounds, mode) |
- the
_dispatch_draw methods looks for methods like e.g.
_draw_mainlayer where
layer is
mainlayer. And there are no layer which is
container so we should be able to remove the
_draw_container methods.
|
handler = getattr(self, "_draw_" + layer, None) |
|
if handler: |
|
handler(gc, view_bounds, mode) |
enable/enable/component.py
Lines 344 to 350 in a1a6059
enable/enable/container.py
Lines 601 to 616 in a1a6059
These seem to have been introduced in the commit - d8fc3d1. This commit seems to have changed the
DEFAULT_DRAWING_ORDERto what we are mostly familiar with -"background", "mainlayer", "border", "overlay"._draw_componentseems to have been introduced as a backwards compatibility measure.As you can see from here -
enable/enable/component.py
Lines 787 to 799 in a1a6059
_dispatch_drawmethods looks for methods like e.g._draw_mainlayerwherelayerismainlayer. And there are no layer which iscontainerso we should be able to remove the_draw_containermethods.enable/enable/component.py
Lines 815 to 817 in a1a6059