Rebol 程式設計/within?
外觀
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)
]
]