LD_Objects.py 文件源码

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

项目:beremiz 作者: nucleron 项目源码 文件源码
def RefreshBoundingBox(self):
        # Calculate the size of the name outside the contact
        text_width, text_height = self.Parent.GetTextExtent(self.Name)
        # Calculate the bounding box size
        if self.Name != "":
            bbx_x = self.Pos.x - max(0, (text_width - self.Size[0]) / 2)
            bbx_width = max(self.Size[0], text_width)
            bbx_y = self.Pos.y - (text_height + 2)
            bbx_height = self.Size[1] + (text_height + 2)
        else:
            bbx_x = self.Pos.x
            bbx_width = self.Size[0]
            bbx_y = self.Pos.y
            bbx_height = self.Size[1]
        self.BoundingBox = wx.Rect(bbx_x, bbx_y, bbx_width + 1, bbx_height + 1)

    # Returns the block minimum size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号