GraphicCommons.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
def TestPoint(self, pt, direction=None, exclude=True):
        inside = False
        check_point = (not exclude) and (direction is None or self.Direction == direction)

        if check_point:
            # Calculate a square around the end point of this connector
            parent_pos = self.ParentBlock.GetPosition()
            x = parent_pos[0] + self.Pos.x + self.Direction[0] * CONNECTOR_SIZE - ANCHOR_DISTANCE
            y = parent_pos[1] + self.Pos.y + self.Direction[1] * CONNECTOR_SIZE - ANCHOR_DISTANCE
            width = ANCHOR_DISTANCE * 2 + abs(self.Direction[0]) * CONNECTOR_SIZE
            height = ANCHOR_DISTANCE * 2 + abs(self.Direction[1]) * CONNECTOR_SIZE
            rect = wx.Rect(x, y, width, height)
            inside = rect.InsideXY(pt.x, pt.y)

        return inside

    # Draws the highlightment of this element if it is highlighted
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号