racket / pict

Other
15 stars 20 forks source link

Negative `scale` exposes internal set-clipping-rect error #45

Closed LiberalArtist closed 5 years ago

LiberalArtist commented 5 years ago

Using a negative argument to scale exposes a violation of the contract on set-clipping-rect blaming (unit language@). I haven't found the definition of language@, so I hope this is the right repository. The error message is essentially the same as with https://github.com/racket/pict/issues/12.

The following sequence of interactions in DrRacket illustrates the problem:

> (require pict)
> (define p (scale (blank 1 1) -1 1))
> p
../../Applications/Racket v7.1/collects/racket/contract/private/blame.rkt:347:0: set-clipping-rect: contract violation
  expected: (and/c real? (not/c negative?))
  given: -1
  in: the 3rd argument of
      (->m
       real?
       real?
       (and/c real? (not/c negative?))
       (and/c real? (not/c negative?))
       void?)
  contract from: (class record-dc%)
  blaming: (unit language@)
   (assuming the contract is correct)

The same interactions work at the racket REPL; trying to draw the pict seems to trigger the error.