Defines a Viewport which renders sub-areas of components
A “window” or “view” into a sub-region of another component.
When a window viewing or containing a component is destroyed, cleanup is called on the component to give it the opportunity to delete any transient state it may have (such as backbuffers).
Given a coordinate X and Y in the viewed component’s coordinate system, returns a coordinate in the coordinate system of the Viewport.
components_at(x, y, add_containers=False)¶
Returns the list of components inside the viewport at the given (x,y) in the viewport’s native coordinate space (not in the space of the component it is viewing).
Although Viewports are not containers, they support this method.
Returns the 3x3 transformation matrix that this interactor will apply to the event (if any).
If we’re initiating layout, act like an OverlayPlotContainer, otherwise do the normal component action
invalidate_draw(damaged_regions=None, self_relative=False, view_relative=False)¶
Invalidates any backbuffer that may exist, and notifies our parents and viewports of any damaged regions.
Call this method whenever a component’s internal state changes such that it must be redrawn on the next draw() call.
Given a coordinate X and Y in the viewport’s coordinate system, returns and X and Y in the coordinate system of the viewed component.