Skip to content

Commit aec75ad

Browse files
committed
update base snapping points
1 parent a909db1 commit aec75ad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/renderer/snap/handlers.cljs

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@
1616
selected-visible (filter #(and (:visible? %)
1717
(:selected? %)) (vals elements))]
1818
(when (:enabled? snap)
19-
(if (and (contains? #{:move :clone} state) (seq selected-visible))
19+
(cond
20+
(and (contains? #{:move :clone} state) (seq selected-visible))
2021
(reduce (fn [points element]
2122
(apply conj points (utils.el/snapping-points element (:options snap))))
2223
[] selected-visible)
24+
25+
(contains? #{:edit :scale} state)
2326
[(mat/add [(:x clicked-element) (:y clicked-element)]
2427
(mat/sub adjusted-pointer-pos
25-
adjusted-pointer-offset))]))))
28+
adjusted-pointer-offset))]
29+
30+
:else
31+
[adjusted-pointer-pos]))))
2632

2733
(defn nearest-neighbors
2834
[db]

0 commit comments

Comments
 (0)