LD_Objects.py 文件源码

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

项目:beremiz 作者: nucleron 项目源码 文件源码
def DrawHighlightment(self, dc):
        scalex, scaley = dc.GetUserScale()
        dc.SetUserScale(1, 1)
        dc.SetPen(MiterPen(HIGHLIGHTCOLOR, (3 * scalex + 5), wx.SOLID))
        dc.SetBrush(wx.TRANSPARENT_BRUSH)
        dc.SetLogicalFunction(wx.AND)
        # Draw a two circle arcs for representing the coil
        dc.DrawEllipticArc(round(self.Pos.x * scalex),
                           round((self.Pos.y - int(self.Size[1] * (sqrt(2) - 1.) / 2.) + 1) * scaley),
                           round(self.Size[0] * scalex),
                           round((int(self.Size[1] * sqrt(2)) - 1) * scaley),
                           135, 225)
        dc.DrawEllipticArc(round(self.Pos.x * scalex),
                           round((self.Pos.y - int(self.Size[1] * (sqrt(2) - 1.) / 2.) + 1) * scaley),
                           round(self.Size[0] * scalex),
                           round((int(self.Size[1] * sqrt(2)) - 1) * scaley),
                           -45, 45)
        dc.SetLogicalFunction(wx.COPY)
        dc.SetUserScale(scalex, scaley)

    # Adds an highlight to the connection
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号