wumpus-basic-0.7.0: Common drawing utilities built on wumpus-core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Graphic.PrimGraphic

Description

Elementary functions for the Graphic and LocGraphic types.

The functions here are generally analogeous to the Picture API in Wumpus.Core, but here they exploit the implicit DrawingContext.

Synopsis

Documentation

strokedEllipse :: Num u => u -> u -> LocGraphic uSource

filledEllipse :: Num u => u -> u -> LocGraphic uSource

supplyPt :: Point2 u -> LocGraphic u -> Graphic uSource

Supplying a point to a CFGraphic takes it to a regular Graphic.

displace :: Num u => u -> u -> Point2 u -> Point2 uSource

strokedRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

filledRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

borderedRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

strokedCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

filledCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

borderedCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

strokedDisk :: Num u => u -> LocGraphic uSource

disk is drawn with Wumpus-Core's ellipse primitive.

This is a efficient representation of circles using PostScript's arc or SVG's circle in the generated output. However, stroked-circles do not draw well after non-uniform scaling - the line width is scaled as well as the shape.

For stroked circles that can be scaled, consider making the circle from Bezier curves.