Painters¶
Painters are used to draw the view.
Protocols¶
Each painter adheres to the Painter protocol.
Some painters, such as FreeHandPainter and BoundingBoxPainter, require a special painter protocol:
Default implementations¶
- class gaphas.painter.PainterChain[source]¶
- Chain up a set of painters. - append(painter: Painter) PainterChain[source]¶
- Add a painter to the list of painters. 
 - prepend(painter: Painter) PainterChain[source]¶
- Add a painter to the beginning of the list of painters. 
 
- class gaphas.painter.HandlePainter(view: GtkView)[source]¶
- Draw handles of items that are marked as selected in the view. 
- class gaphas.painter.FreeHandPainter(item_painter: ItemPainterType, sloppiness: float = 0.5)[source]¶
- This painter is a wrapper for an Item painter. The Cairo context is modified to allow for a sloppy, hand written drawing style. - Range [0..2.0] gives acceptable results. - Draftsman: 0.0 
- Artist: 0.25 
- Cartoonist: 0.5 
- Child: 1.0 
- Drunk: 2.0 
 
Rubberband tool¶
A special painter is used to display rubberband selection. This painter shares some state with the rubberband tool.