GraphicCommons.py 文件源码

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

项目:beremiz 作者: nucleron 项目源码 文件源码
def DrawHighlightment(self, dc):
        scalex, scaley = dc.GetUserScale()
        dc.SetUserScale(1, 1)
        dc.SetPen(MiterPen(HIGHLIGHTCOLOR))
        dc.SetBrush(wx.Brush(HIGHLIGHTCOLOR))
        dc.SetLogicalFunction(wx.AND)

        left = (self.Pos.x - 1) * scalex - 2
        right = (self.Pos.x + self.Size[0] + 1) * scalex + 2
        top = (self.Pos.y - 1) * scaley - 2
        bottom = (self.Pos.y + self.Size[1] + 1) * scaley + 2
        angle_top = (self.Pos.x + self.Size[0] - 9) * scalex + 2
        angle_right = (self.Pos.y + 9) * scaley - 2

        polygon = [wx.Point(left, top), wx.Point(angle_top, top),
                   wx.Point(right, angle_right), wx.Point(right, bottom),
                   wx.Point(left, bottom)]
        dc.DrawPolygon(polygon)

        dc.SetLogicalFunction(wx.COPY)
        dc.SetUserScale(scalex, scaley)

    # Draws the comment and its content
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号