diff options
Diffstat (limited to 'scripts/utils.scm')
-rw-r--r-- | scripts/utils.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/utils.scm b/scripts/utils.scm new file mode 100644 index 0000000..3348075 --- /dev/null +++ b/scripts/utils.scm @@ -0,0 +1,8 @@ +(define (is-point-inside-rect? point rect) + (cond ((not (point? point)) #f) + ((not (rect? rect)) #f) + (else (and (>= (point-x point) (rect-x rect)) + (>= (point-y point) (rect-y rect)) + (<= (point-x point) (+ (rect-x rect) (rect-width rect))) + (<= (point-y point) (+ (rect-y rect) (rect-height rect)))) + ))) |