diff --git a/collects/racket/draw/private/dc.rkt b/collects/racket/draw/private/dc.rkt index bdab5443fd..5112e83f3a 100644 --- a/collects/racket/draw/private/dc.rkt +++ b/collects/racket/draw/private/dc.rkt @@ -379,8 +379,11 @@ (cairo_matrix_translate mx origin-x origin-y) (cairo_matrix_scale mx scale-x scale-y) (cairo_matrix_rotate mx (- rotation)) - (set! effective-scale-x (cairo_matrix_t-xx mx)) - (set! effective-scale-y (cairo_matrix_t-yy mx)) + (let ([ssq (lambda (a b) (sqrt (+ (* a a) (* b b))))]) + (set! effective-scale-x (ssq (cairo_matrix_t-xx mx) + (cairo_matrix_t-xy mx))) + (set! effective-scale-y (ssq (cairo_matrix_t-yy mx) + (cairo_matrix_t-yx mx)))) (set! effective-origin-x (cairo_matrix_t-x0 mx)) (set! effective-origin-y (cairo_matrix_t-y0 mx)) (let ([v (vector (cairo_matrix_t-xx mx) @@ -448,13 +451,14 @@ (cairo_matrix_translate mx origin-x origin-y) (cairo_matrix_scale mx scale-x scale-y) (cairo_matrix_rotate mx (- rotation)) - (cairo_matrix_multiply mx mx mx2) + (cairo_matrix_multiply mx mx2 mx) (set! origin-x 0.0) (set! origin-y 0.0) (set! scale-x 1.0) (set! scale-y 1.0) (set! rotation 0.0) (set! matrix mx) + (reset-effective!) (reset-matrix))) (def/public (set-initial-matrix [matrix-vector? m]) diff --git a/collects/scribblings/draw/dc-intf.scrbl b/collects/scribblings/draw/dc-intf.scrbl index d014f22f5e..966b61e36b 100644 --- a/collects/scribblings/draw/dc-intf.scrbl +++ b/collects/scribblings/draw/dc-intf.scrbl @@ -1151,7 +1151,7 @@ rotation settings have their identity values. [dy real?]) void?]{ -Adds a scaling of @racket[dx] in the X-direction and @racket[dy] in +Adds a translation of @racket[dx] in the X-direction and @racket[dy] in the Y-direction to the drawing context's current transformation. Afterward, the drawing context's transformation is represented in the