mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 00:49:28 -05:00
🐛 Improvements over snap distances
This commit is contained in:
parent
636e66943b
commit
07ba79a64c
2 changed files with 3 additions and 5 deletions
|
@ -21,7 +21,7 @@
|
||||||
[uxbox.util.geom.snap-points :as sp]))
|
[uxbox.util.geom.snap-points :as sp]))
|
||||||
|
|
||||||
(def ^:private snap-accuracy 5)
|
(def ^:private snap-accuracy 5)
|
||||||
(def ^:private snap-distance-accuracy 5)
|
(def ^:private snap-distance-accuracy 10)
|
||||||
|
|
||||||
(defn- remove-from-snap-points [remove-id?]
|
(defn- remove-from-snap-points [remove-id?]
|
||||||
(fn [query-result]
|
(fn [query-result]
|
||||||
|
@ -145,9 +145,7 @@
|
||||||
(filter #(<= (mth/abs %) snap-distance-accuracy))
|
(filter #(<= (mth/abs %) snap-distance-accuracy))
|
||||||
(reduce min ##Inf))]
|
(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]
|
(defn select-shapes-area [page-id shapes objects area-selrect]
|
||||||
(->> (uw/ask! {:cmd :selection/query
|
(->> (uw/ask! {:cmd :selection/query
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
pair->distance+pair
|
pair->distance+pair
|
||||||
(fn [[sh1 sh2]]
|
(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?
|
contains-selected?
|
||||||
(fn [selected pairs]
|
(fn [selected pairs]
|
||||||
|
|
Loading…
Add table
Reference in a new issue