0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

🐛 Fix negative sizes in tracks grid editor

This commit is contained in:
alonso.torres 2023-12-04 13:01:42 +01:00 committed by Andrey Antukh
parent 41d420234a
commit 203f36e064
2 changed files with 6 additions and 2 deletions

View file

@ -1003,6 +1003,7 @@
:value (:value column)
:on-change #(set-column-value type index %)
:placeholder "--"
:min 0
:disabled (= :auto (:type column))}]]
[:div {:class (stl/css :track-info-unit)}

View file

@ -417,12 +417,15 @@
precision (if snap-pixel? mth/round identity)
delta (/ (get position axis) zoom)
new-size-before (max 0 (precision (+ @start-size-before delta)))
new-size-after (max 0 (precision (- @start-size-after delta)))
shape
(-> shape
(cond-> (some? track-before)
(update-in [tracks-prop (dec index)] merge {:type :fixed :value (precision (+ @start-size-before delta))}))
(update-in [tracks-prop (dec index)] merge {:type :fixed :value new-size-before}))
(cond-> (some? track-after)
(update-in [tracks-prop index] merge {:type :fixed :value (precision (- @start-size-after delta))})))
(update-in [tracks-prop index] merge {:type :fixed :value new-size-after})))
modifiers
(-> (ctm/empty)