🐛 On a variants switch, keep the value of the rotation and its transformations (#7165)

This commit is contained in:
Pablo Alba 2025-08-21 13:55:16 +02:00 committed by GitHub
parent 0e4cf23a93
commit 7023880e67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]