0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-14 16:51:18 -05:00

🐛 Fix problem resizing on click

This commit is contained in:
alonso.torres 2025-02-26 12:33:52 +01:00 committed by Alejandro Alonso
parent 2c789e48f3
commit 265675795e
2 changed files with 36 additions and 23 deletions

View file

@ -15,6 +15,7 @@
### :bug: Bugs fixed
- Fix opacity in frame containers [Github #5858](https://github.com/penpot/penpot/pull/5858)
- Avoid resizing on click [Taiga #10213](https://tree.taiga.io/project/penpot/issue/10213)
## 2.5.2

View file

@ -275,9 +275,10 @@
(->> (snap/closest-snap-point page-id shapes objects layout zoom focus point)
(rx/map #(conj current %)))))
(rx/map #(resize shape initial-position layout %))
(rx/share))]
(rx/share))
(rx/concat
modifiers-stream
(rx/merge
(->> resize-events-stream
(rx/mapcat
@ -299,7 +300,18 @@
(rx/last)
(rx/map #(dwm/apply-modifiers {:modifiers (dwm/create-modif-tree ids %)
:ignore-constraints (contains? layout :scale-text)})))
(rx/empty)))
(rx/empty)))]
(rx/concat
;; This initial stream waits for some pixels to be move before making the resize
;; if you make a click in the border will not make a resize
(->> ms/mouse-position
(rx/map #(gpt/to-vec initial-position %))
(rx/map #(gpt/length %))
(rx/filter #(> % (/ 10 zoom)))
(rx/take 1)
(rx/mapcat (fn [] modifiers-stream))
(rx/take-until stopper))
(rx/of
(if (features/active-feature? state "render-wasm/v1")