Handbook
Glossary
contains-rect? ( rect1 rect2 -- ? )
Factor handbook
»
UI framework
»
Building user interfaces
»
Gadget geometry
»
Rectangles
Prev:
rect-union ( rect1 rect2 -- newrect )
Next:
contains-point? ( point rect -- ? )
Vocabulary
math
.
rectangles
Inputs
rect1
a
rect
rect2
a
rect
Outputs
?
a
boolean
Word description
Tests if two rectangles have a non-empty intersection.
Definition
IN:
math.rectangles
GENERIC:
contains-rect?
( rect1 rect2 -- ? )
Methods
USING:
accessors
generic
kernel
math.rectangles
ui.gadgets
;
M:
gadget
contains-rect?
dup
visible?>>
[
M\
gadget
contains-rect?
(call-next-method)
]
[
2drop
f
]
if
;
USING:
kernel
math.rectangles
math.vectors
;
M:
rect
contains-rect?
(rect-intersect)
[v-]
{
0 0
}
=
;