From 0b1d3eeed88451c2c428de3d8904f21b4b1baade Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 14 Dec 2022 12:53:28 -0500 Subject: node-2d: Fix local bounding box fast path. --- catbird/node-2d.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm index dc561ba..a6a70bd 100644 --- a/catbird/node-2d.scm +++ b/catbird/node-2d.scm @@ -175,11 +175,11 @@ (= (vec2-y k) 0.0)) ;; Fast path: Node is axis-aligned and bounding box ;; calculation is easy peasy. - (let ((s (scale node))) + (let ((z (scale node))) (set-rect-x! bb (- (vec2-x p) (vec2-x o))) (set-rect-y! bb (- (vec2-y p) (vec2-y o))) - (set-rect-width! bb (* (rect-width s) (vec2-x s))) - (set-rect-height! bb (* (rect-height s) (vec2-y s)))) + (set-rect-width! bb (* (rect-width s) (vec2-x z))) + (set-rect-height! bb (* (rect-height s) (vec2-y z)))) ;; Slow path: Node is rotated, sheared, or both. (let* ((m (local-matrix node)) (x0 0.0) -- cgit v1.2.3