From 11b7b458bf586d2a1a564c74c6f2fcf2fe1170d9 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 7 Oct 2025 18:29:18 +0200 Subject: [PATCH] :bug: Auto-width changes to fixed when switching variants (#7449) * :bug: Auto-width changes to fixed when switching variants * :paperclip: Fix typo on changes --------- Co-authored-by: Andrey Antukh --- CHANGES.md | 3 ++- common/src/app/common/logic/libraries.cljc | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6290c2e416..9870342acc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -47,7 +47,8 @@ - Fix multi level library dependencies [Taiga #12155](https://tree.taiga.io/project/penpot/issue/12155) - Fix component context menu options order in assets tab [Taiga #11941](https://tree.taiga.io/project/penpot/issue/11941) - Fix error updating library [Taiga #12218](https://tree.taiga.io/project/penpot/issue/12218) -- Fix Restoring a variant in another file makes it overlap the existing variant [Taiga #12049](https://tree.taiga.io/project/penpot/issue/12049) +- Fix restoring a variant in another file makes it overlap the existing variant [Taiga #12049](https://tree.taiga.io/project/penpot/issue/12049) +- Fix auto-width changes to fixed when switching variants [Taiga #12172](https://tree.taiga.io/project/penpot/issue/12172) ## 2.10.1 (Unreleased) diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index e047180ebe..007927188d 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -2029,10 +2029,14 @@ reset-pos-data? (and (not skip-operations?) (cfh/text-shape? previous-shape) - (= attr :position-data) + (or (= attr :position-data) (= attr :selrect)) (not= (:position-data previous-shape) (:position-data current-shape)) (touched :geometry-group)) + skip-operations? (or skip-operations? + ;; If we are going to reset the position data, skip the selrect attr + (and reset-pos-data? (= attr :selrect))) + attr-val (when-not skip-operations? (cond