🐛 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:
Andrey Antukh 2023-09-22 09:56:21 +02:00
parent 2bd31dcbd2
commit 3ec29273d0

View file

@ -159,7 +159,10 @@
;; Left/Top shapes and right/bottom shapes (depends on `coord` parameter)
;; 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)
gt-distances (into #{} distances-xf gt-shapes)
distances (set/union lt-distances gt-distances)