fix bitmap rotate/flip interaction
closes PR 14585
This commit is contained in:
parent
f347af3c98
commit
a3370be15d
|
@ -775,9 +775,8 @@
|
||||||
[flipped? (flip-flipped? atomic-shape)])
|
[flipped? (flip-flipped? atomic-shape)])
|
||||||
(make-flip flipped?
|
(make-flip flipped?
|
||||||
(make-ibitmap (ibitmap-raw-bitmap bitmap)
|
(make-ibitmap (ibitmap-raw-bitmap bitmap)
|
||||||
(bring-between (if flipped?
|
(bring-between
|
||||||
(- (ibitmap-angle bitmap) θ)
|
(+ (ibitmap-angle bitmap) θ)
|
||||||
(+ (ibitmap-angle bitmap) θ))
|
|
||||||
360)
|
360)
|
||||||
(ibitmap-x-scale bitmap)
|
(ibitmap-x-scale bitmap)
|
||||||
(ibitmap-y-scale bitmap)
|
(ibitmap-y-scale bitmap)
|
||||||
|
@ -911,8 +910,13 @@
|
||||||
[(text? atomic-shape)
|
[(text? atomic-shape)
|
||||||
(error 'flip "cannot flip shapes that contain text")]
|
(error 'flip "cannot flip shapes that contain text")]
|
||||||
[(flip? atomic-shape)
|
[(flip? atomic-shape)
|
||||||
|
(define bitmap (flip-shape atomic-shape))
|
||||||
(make-flip (not (flip-flipped? atomic-shape))
|
(make-flip (not (flip-flipped? atomic-shape))
|
||||||
(flip-shape atomic-shape))]))
|
(make-ibitmap (ibitmap-raw-bitmap bitmap)
|
||||||
|
(bring-between (- (ibitmap-angle bitmap)) 360)
|
||||||
|
(ibitmap-x-scale bitmap)
|
||||||
|
(ibitmap-y-scale bitmap)
|
||||||
|
(make-hash)))]))
|
||||||
|
|
||||||
(define (flip-point point) (make-point (point-x point) (- (point-y point))))
|
(define (flip-point point) (make-point (point-x point) (- (point-y point))))
|
||||||
(define (flip-points points) (map flip-point points))
|
(define (flip-points points) (map flip-point points))
|
||||||
|
|
|
@ -1603,6 +1603,11 @@
|
||||||
=>
|
=>
|
||||||
(to-img (make-object image-snip% green-blue-20x10-bitmap)))
|
(to-img (make-object image-snip% green-blue-20x10-bitmap)))
|
||||||
|
|
||||||
|
(let ([b (freeze (beside (rectangle 4 8 "solid" "blue") (rectangle 4 8 "solid" "red")))])
|
||||||
|
(test (flip-vertical (rotate 90 b))
|
||||||
|
=>
|
||||||
|
(rotate -90 b)))
|
||||||
|
|
||||||
;; make sure that raw image snips are equal to image snips
|
;; make sure that raw image snips are equal to image snips
|
||||||
(let ([i1 (make-object image-snip% (collection-file-path "bug09.png" "icons"))]
|
(let ([i1 (make-object image-snip% (collection-file-path "bug09.png" "icons"))]
|
||||||
[i2 (make-object image-snip% (collection-file-path "bug09.png" "icons"))])
|
[i2 (make-object image-snip% (collection-file-path "bug09.png" "icons"))])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user