mirror of
https://github.com/penpot/penpot.git
synced 2025-06-20 05:36:59 +02:00
🐛 Fix unexpected bug on snap_disatches when shape is nil
Happens when you move something like svg-dev which for some reason becomes nil on snap distances code
This commit is contained in:
parent
2bd31dcbd2
commit
3ec29273d0
1 changed files with 5 additions and 2 deletions
|
@ -159,10 +159,13 @@
|
||||||
;; Left/Top shapes and right/bottom shapes (depends on `coord` parameter)
|
;; Left/Top shapes and right/bottom shapes (depends on `coord` parameter)
|
||||||
|
|
||||||
;; Gets the distance to the current selection
|
;; Gets the distance to the current selection
|
||||||
distances-xf (comp (map distance-to-selrect) (filter pos?))
|
distances-xf (comp (filter some?)
|
||||||
|
(map distance-to-selrect)
|
||||||
|
(filter pos?))
|
||||||
|
|
||||||
lt-distances (into #{} distances-xf lt-shapes)
|
lt-distances (into #{} distances-xf lt-shapes)
|
||||||
gt-distances (into #{} distances-xf gt-shapes)
|
gt-distances (into #{} distances-xf gt-shapes)
|
||||||
distances (set/union lt-distances gt-distances)
|
distances (set/union lt-distances gt-distances)
|
||||||
|
|
||||||
;; We'll show the distances that match a distance from the selrect
|
;; We'll show the distances that match a distance from the selrect
|
||||||
show-candidate? #(check-in-set % distances)
|
show-candidate? #(check-in-set % distances)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue