Bad window dimensions could produce better error messages
Closed this issue · 2 comments
takikawa commented
The following snippet has some bad window dimensions
#lang racket
(require metapict)
(with-window (window 100 100 100 100)
(draw (curve origo -- (pt 10 10))))
Running it gives /: division by zero
.
soegaard commented
Hi,
I have added a guard for the window constructor.
Now an attempt to construct a window with an empty x- or y-range provokes an error.
soegaard commented
I moved the test to with-window. The guard on the window structure prevents the intersection code to create windows with empty ranges. Now the documentation builds again.