🐛 Fix setting shape size to zero

This commit is contained in:
Andrés Moya 2025-09-01 12:07:33 +02:00 committed by Andrés Moya
parent dac2d31b35
commit 0df420d353
2 changed files with 7 additions and 1 deletions

View File

@ -35,6 +35,7 @@
- Misleading affordance in saved versions [Taiga #11887](https://tree.taiga.io/project/penpot/issue/11887)
- Fix pasting RTF text crashes penpot [Taiga #11717](https://tree.taiga.io/project/penpot/issue/11717)
- Fix navigation arrows in Libraries & Templates carousel [Taiga #10609](https://tree.taiga.io/project/penpot/issue/10609)
- Fix applying tokens with zero value to size [Taiga #11618](https://tree.taiga.io/project/penpot/issue/11618)
## 2.9.0

View File

@ -466,7 +466,12 @@
(dm/assert! (#{:width :height} attr))
(dm/assert! (number? value))
(let [{:keys [proportion proportion-lock]} shape
(let [;; Avoid havig shapes with zero size
value (if (< (mth/abs value) 0.01)
0.01
value)
{:keys [proportion proportion-lock]} shape
size (select-keys (:selrect shape) [:width :height])
new-size (if-not (and (not ignore-lock?) proportion-lock)
(assoc size attr value)