Incremental area selection

This commit is contained in:
alonso.torres 2021-07-08 17:37:21 +02:00
parent 3a64efd136
commit 55d2acdf13
9 changed files with 41 additions and 22 deletions

View file

@ -208,3 +208,4 @@
(d/export gin/overlaps?)
(d/export gin/has-point?)
(d/export gin/has-point-rect?)
(d/export gin/rect-contains-shape?)

View file

@ -302,3 +302,9 @@
(let [lines (points->lines (:points shape))]
;; TODO: Will only work for simple shapes
(is-point-inside-evenodd? point lines)))
(defn rect-contains-shape?
[rect shape]
(->> shape
:points
(every? (partial has-point-rect? rect))))