如何使 rect.intersects 仅检查外部边界
我正在尝试确定画布上单击鼠标创建的矩形 clickRectangle 是否与 DrawingRectangle 相交。
但是,我不希望 intersects 方法返回 true,如果我单击latedRectangle 中的任何位置(即矩形的内部),我只希望它在单击drawnRectangle 的外部边界时返回 true。
我怎样才能做到这一点?
PS:对于clickRectangle和drawnRectangle请参阅下面我的评论。
I am trying to determine if clickRectangle, a rectangle created by the click of a mouse, on a canvas intersects with a drawnRectangle or not.
However, I don't want the intersects method to return true if I click anywhere in the drawnRectangle (i.e. the interior of the rectangle), I just want it to return true if an outer boundary of drawnRectangle was clicked.
How can I do that?
P.S: For clickRectangle and drawnRectangle see my comment below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解这个问题,你想要
If I understand the question correctly, you want