enable.savage.compliance.crosshair module

Cross-hair tool for measuring SVG rendering results.

class enable.savage.compliance.crosshair.Crosshair(component=None, **traits)[source]

Bases: enable.base_tool.BaseTool

Display a crosshair at the given SVG coordinates.

This will do the appropriate transformations in order to map Enable coordinates to SVG coordinates.

do_layout(*args, **kw)[source]
draw(gc, view_bounds=None)[source]

Draws this tool on a graphics context.

It is assumed that the graphics context has a coordinate transform that matches the origin of its component. (For containers, this is just the origin; for components, it is the origin of their containers.)

ensure_redraw(event=None)[source]
normal_mouse_enter(event)[source]
normal_mouse_leave(event)[source]
normal_mouse_move(event)[source]

Handles the mouse being moved.

overlay(component, gc, view_bounds=None, mode='normal')[source]

Draws this component overlaid on a graphics context.

class enable.savage.compliance.crosshair.MultiController(*crosshairs, **traits)[source]

Bases: traits.has_traits.HasTraits

Keep multiple Crosshairs in sync.

add(crosshair)[source]

Synch a new Crosshair.

remove(crosshair)[source]

Unsynch a recorded Crosshair.