From 5e70dc863e7d965241a8d456e99d500d9f389fcc Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 12 Feb 2011 12:00:57 -0600 Subject: [PATCH] Revert "at attempt to use the dc's scale and rotation to instead of doing the rotation in racket" This reverts commit 7eefe74e93e6ceda0c1baa370f4dc89e68863e70. --- collects/mrlib/image-core.rkt | 47 ++++++++--------------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/collects/mrlib/image-core.rkt b/collects/mrlib/image-core.rkt index 4064efc10d..8df14e75b3 100644 --- a/collects/mrlib/image-core.rkt +++ b/collects/mrlib/image-core.rkt @@ -863,43 +863,16 @@ has been moved out). (send dc set-brush (mode-color->brush mode color)) (send dc set-smoothing (mode-color->smoothing mode color)) (send dc draw-path path dx dy)))] - [(flip? np-atomic-shape) - (cond - [#t ; (flip-flipped? np-atomic-shape) - (let ([bm (get-rendered-bitmap np-atomic-shape)]) - (send dc set-smoothing 'smoothed) - (send dc draw-bitmap - bm - (- dx (/ (send bm get-width) 2)) - (- dy (/ (send bm get-height) 2)) - 'solid - (send the-color-database find-color "black") - (get-rendered-mask np-atomic-shape)))] - - [else - ;; this only works when the scale is 1 and there is no flipping - (define bitmap (flip-shape np-atomic-shape)) - (define-values (orig-bitmap-obj orig-mask-obj) (values (ibitmap-raw-bitmap bitmap) - (ibitmap-raw-mask bitmap))) - (define θ (degrees->radians (ibitmap-angle bitmap))) - (define w (send orig-bitmap-obj get-width)) - (define h (send orig-bitmap-obj get-height)) - (define c2 - (* (- (make-rectangular dx dy) - (* (make-polar 1 (- θ)) - (make-rectangular (/ w 2) (/ h 2)))) - (make-polar 1 θ))) - - (define orig-rotation (send dc get-rotation)) - (send dc set-rotation θ) - (send dc draw-bitmap - orig-bitmap-obj - (real-part c2) - (imag-part c2) - 'solid - (send the-color-database find-color "black") - orig-mask-obj) - (send dc set-rotation orig-rotation)])] + [(flip? np-atomic-shape) + (let ([bm (get-rendered-bitmap np-atomic-shape)]) + (send dc set-smoothing 'smoothed) + (send dc draw-bitmap + bm + (- dx (/ (send bm get-width) 2)) + (- dy (/ (send bm get-height) 2)) + 'solid + (send the-color-database find-color "black") + (get-rendered-mask np-atomic-shape)))] [(text? np-atomic-shape) (let ([θ (degrees->radians (text-angle np-atomic-shape))] [font (send dc get-font)])