puzzle-draw-0.3.0.0: Creating graphics for pencil puzzles.

Safe HaskellNone
LanguageHaskell98

Draw.Lib

Synopsis

Documentation

vline :: Backend' b => Double -> Diagram b Source #

Vertical/horizontal stroked line of given length.

hline :: Backend' b => Double -> Diagram b Source #

Vertical/horizontal stroked line of given length.

hcatsep :: (InSpace V2 Double a, Juxtaposable a, HasOrigin a, Monoid' a) => [a] -> a Source #

Variant of hcat' that spreads with distance 1.

vcatsep :: (InSpace V2 Double a, Juxtaposable a, HasOrigin a, Monoid' a) => [a] -> a Source #

Variant of vcat' that spreads with distance 1, and stacks towards the top.

smash :: Backend' b => Diagram b -> Diagram b Source #

Collapse the envelope to a point.

translatep :: (InSpace V2 Double t, Transformable t) => (Int, Int) -> t -> t Source #

Helper to translate by a point given as (Int, Int).

r2i :: (Int, Int) -> V2 Double Source #

Convert pair of Int to vector.

p2i :: (Int, Int) -> P2 Double Source #

Convert pair of Int to point.

interleave :: [a] -> [a] -> [a] Source #

Interleave two lists.

spread :: Backend' b => V2 Double -> [Diagram b] -> Diagram b Source #

Spread diagrams evenly along the given vector.

besidesL :: Backend' b => Diagram b -> Diagram b -> Diagram b Source #

Place the second diagram to the right of the first, aligning both vertically. The origin is the origin of the left diagram.

besidesR :: Backend' b => Diagram b -> Diagram b -> Diagram b Source #

Variant of besidesL where the origin is that of the right diagram.

fit :: (Transformable t, Enveloped t, InSpace V2 Double t) => Double -> t -> t Source #

fit f a scales a to fit into a square of size f.

text'' :: Backend' b => Font -> String -> Diagram b Source #

Write text that is centered both vertically and horizontally and that has an envelope. Sized such that single capital characters fit nicely into a square of size 1.

phantom' :: Backend' b => Diagram b -> Diagram b Source #

Variant of phantom that forces the argument backend type.