I've observed this with a program like this one from my Frosthaven project, so you'll want to raco pkg install https://github.com/benknoble/frosthaven-manager to see the problem:
In particular, make the window small enough that you need the vertical scroll, and watch what happens to the "boot" when you do. (Adding more lines gets more interesting.) Also note that in the final version where I fix the coordinates so I don't need flip-y, I use (rotate _ (/ pi -6)) instead of (rotate _ (/ pi 6)), which dovetails with comments below about rotations/etc.
@mflatt writes:
Just from a quick look, is there a reason to set the initial transformation matrix instead of using transform? I expected to see a combination of get-transformation, transform and set-transformation, instead. (If dc<%> were started from scratch, there would just be the current transformation — and a separate scale, offset, etc., would not be accessible.)
Another issue is that flip-x and flip-y lose track of nested picts. Impleemnting it with scale and inset, instead, would avoid those problems.
A DC's state is four transformations, applied in order: initial matrix, translation, scale, and rotation. If the current transformation is based on non-identity variants of the last three, then directly setting the initial matrix one will have a weird effect, because the last three happen after that.
https://github.com/racket/pict/blob/8328b9049e6821f5f9b1ae089abf44bd6459f2fb/pict-lib/pict/private/utils.rkt#L1347
Introduced by me and @soegaard in https://github.com/racket/pict/commit/8328b9049e6821f5f9b1ae089abf44bd6459f2fb (cf. https://github.com/racket/pict/issues/29, https://github.com/racket/pict/pull/78).
I've observed this with a program like this one from my Frosthaven project, so you'll want to
raco pkg install https://github.com/benknoble/frosthaven-manager
to see the problem:In particular, make the window small enough that you need the vertical scroll, and watch what happens to the "boot" when you do. (Adding more lines gets more interesting.) Also note that in the final version where I fix the coordinates so I don't need
flip-y
, I use(rotate _ (/ pi -6))
instead of(rotate _ (/ pi 6))
, which dovetails with comments below about rotations/etc.@mflatt writes: