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

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Graphic.GraphicOperations

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.

displace :: Num u => u -> u -> PointDisplace 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.