mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
🐛 Fix problem with snap points
This commit is contained in:
parent
e474accb61
commit
188f5c6167
1 changed files with 10 additions and 9 deletions
|
@ -15,15 +15,16 @@
|
|||
|
||||
(defn rect->snap-points
|
||||
[rect]
|
||||
(let [x (dm/get-prop rect :x)
|
||||
y (dm/get-prop rect :y)
|
||||
w (dm/get-prop rect :width)
|
||||
h (dm/get-prop rect :height)]
|
||||
#{(gpt/point x y)
|
||||
(gpt/point (+ x w) y)
|
||||
(gpt/point (+ x w) (+ y h))
|
||||
(gpt/point x (+ y h))
|
||||
(grc/rect->center rect)}))
|
||||
(when (some? rect)
|
||||
(let [x (dm/get-prop rect :x)
|
||||
y (dm/get-prop rect :y)
|
||||
w (dm/get-prop rect :width)
|
||||
h (dm/get-prop rect :height)]
|
||||
#{(gpt/point x y)
|
||||
(gpt/point (+ x w) y)
|
||||
(gpt/point (+ x w) (+ y h))
|
||||
(gpt/point x (+ y h))
|
||||
(grc/rect->center rect)})))
|
||||
|
||||
(defn- frame->snap-points
|
||||
[frame]
|
||||
|
|
Loading…
Add table
Reference in a new issue