Handbook
Glossary
contains-point? ( point rect -- ? )
Factor handbook
»
UI framework
»
Building user interfaces
»
Gadget geometry
»
Rectangles
Prev:
contains-rect? ( rect1 rect2 -- ? )
Next:
offset-rect ( rect loc -- newrect )
Vocabulary
math
.
rectangles
Inputs
point
a pair of integers
rect
a
rect
Outputs
?
a
boolean
Word description
Tests if a rectangle contains a point.
Definition
IN:
math.rectangles
GENERIC:
contains-point?
( point rect -- ? )
Methods
USING:
accessors
generic
kernel
math.rectangles
ui.gadgets
;
M:
gadget
contains-point?
dup
visible?>>
[
M\
gadget
contains-point?
(call-next-method)
]
[
2drop
f
]
if
;
USING:
kernel
math.rectangles
;
M:
rect
contains-point?
[
point>rect
]
dip
contains-rect?
;