发布网友 发布时间:2024-09-29 05:06
共2个回答
热心网友 时间:2024-10-23 18:46
你的思路不太对,应该判断两个shape有交叉,或者,shape2的上下左右4个属性在shape1中,即:
if (shape2.left >= shape1.left)
and (shape2.right <= shape1.right)
and (shape2.top >= shape1.top)
and (shape2.bottom <= shape1.bottom) then
.......
类似的,还可用Windows API函数,如PtInRect等
热心网友 时间:2024-10-23 18:46
你的思路不太对,应该判断两个shape有交叉,或者,shape2的上下左右4个属性在shape1中,即:
if
(shape2.left
>=
shape1.left)
and
(shape2.right
<=
shape1.right)
and
(shape2.top
>=
shape1.top)
and
(shape2.bottom
<=
shape1.bottom)
then
.......
类似的,还可用Windows
API函数,如PtInRect等