wumpus-basic-0.11.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

centermonoTextline :: (Fractional u, Ord u, FromPtSize u) => String -> LocGraphic uSource

As textline but the supplied point is the center.

Centered is inexact - it is calculated with monospaced font metrics.

textlineMulti :: Fractional u => [String] -> LocGraphic uSource

Point is the baseline left of the bottom line, text is left-aligned.

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.

vecdisplace :: Num u => Vec2 u -> Point2 u -> Point2 uSource

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

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

vdisplace :: Num 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.