From 7023880e67820fccefbc041e3bfa6079d689c432 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 21 Aug 2025 13:55:16 +0200 Subject: [PATCH] :bug: On a variants switch, keep the value of the rotation and its transformations (#7165) --- common/src/app/common/logic/libraries.cljc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index 8022e3377f..7beec359cb 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -2020,7 +2020,6 @@ skip-operations? (or skip-operations? (= attr-val (get current-shape attr))) - ;; On a text-change, we want to force a position-data reset ;; so it's calculated again [roperations uoperations] @@ -2028,6 +2027,16 @@ (add-update-attr-operations :position-data current-shape roperations uoperations nil) [roperations uoperations]) + ;; On a rotation operation we need to keep also the transformation matrixes + [roperations uoperations] + (if (and (not skip-operations?) (= attr :rotation)) + (let [[roperations uoperations] + (add-update-attr-operations + :transform current-shape roperations uoperations (:transform previous-shape))] + (add-update-attr-operations + :transform-inverse current-shape roperations uoperations (:transform-inverse previous-shape))) + [roperations uoperations]) + [roperations' uoperations'] (if skip-operations? [roperations uoperations]