Rebol 编程/within?
外观
< Rebol 编程
WITHIN? point offset size
如果点在矩形边界内,则返回 TRUE。
WITHIN? 是一个函数值。
- 点 -- XY 位置(类型:对)
- 偏移 -- 区域偏移(类型:对)
- 大小 -- 区域大小(类型:对)
within?: func [
{Return TRUE if the point is within the rectangle bounds.}
point [pair!] "XY position"
offset [pair!] "Offset of area"
size [pair!] "Size of area"
][
found? all [
point/x >= offset/x
point/y >= offset/y
point/x < (offset/x + size/x)
point/y < (offset/y + size/y)
]
]