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:
parent
41d420234a
commit
203f36e064
2 changed files with 6 additions and 2 deletions
|
@ -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)}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue