Description
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
# ------------------------------------------------------------------------
# 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 )
# -------------------------------------------------------------------------
# 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 )
Reactions are currently unavailable
You can’t perform that action at this time.
enable/enable/component.py
Lines 344 to 350 in 3d138a2
enable/enable/container.py
Lines 383 to 392 in 3d138a2
enable/enable/container.py
Lines 597 to 616 in 3d138a2
enable/enable/container.py
Lines 618 to 636 in 3d138a2