Better error message for outputs with zero width or height, or better default #33

Open
byorgey opened this Issue Sep 23, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Owner

byorgey commented Sep 23, 2013

If one attempts to render an output with a height or width of zero, currently one simply gets an error like user error (error while writing to output stream). For example, given Test.hs containing

import           Diagrams.Backend.Cairo.CmdLine
import           Diagrams.Prelude

main = defaultMain (hrule 1)

we obtain the following:

$ ghc --make Test && ./Test -w 100 -o Test.png
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking Test ...
Test: user error (error while writing to output stream)

Note that we only specify a width on the command line; if we specify an explicit height it works fine.

We should at the very least generate a nice error message; or perhaps we could replace a height of 0 by the width, and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment