mirror of
https://github.com/penpot/penpot.git
synced 2026-02-26 22:34:11 +00:00
🐛 Improvements over snap distances
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
[uxbox.util.geom.snap-points :as sp]))
|
||||
|
||||
(def ^:private snap-accuracy 5)
|
||||
(def ^:private snap-distance-accuracy 5)
|
||||
(def ^:private snap-distance-accuracy 10)
|
||||
|
||||
(defn- remove-from-snap-points [remove-id?]
|
||||
(fn [query-result]
|
||||
@@ -145,9 +145,7 @@
|
||||
(filter #(<= (mth/abs %) snap-distance-accuracy))
|
||||
(reduce min ##Inf))]
|
||||
|
||||
(if (mth/finite? min-snap) [0 min-snap] nil))
|
||||
|
||||
)))))
|
||||
(if (mth/finite? min-snap) [0 min-snap] nil)))))))
|
||||
|
||||
(defn select-shapes-area [page-id shapes objects area-selrect]
|
||||
(->> (uw/ask! {:cmd :selection/query
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
pair->distance+pair
|
||||
(fn [[sh1 sh2]]
|
||||
[(-> (gsh/distance-shapes sh1 sh2) coord mth/round) [sh1 sh2]])
|
||||
[(-> (gsh/distance-shapes sh1 sh2) coord (mth/precision 2)) [sh1 sh2]])
|
||||
|
||||
contains-selected?
|
||||
(fn [selected pairs]
|
||||
|
||||
Reference in New Issue
Block a user