LD_Objects.py 文件源码

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

项目:beremiz 作者: nucleron 项目源码 文件源码
def RefreshConnectors(self):
        scaling = self.Parent.GetScaling()
        height = self.Size[1] - self.Extensions[0] - self.Extensions[1]
        interval = float(height) / float(max(len(self.Connectors) - 1, 1))
        for i, connector in enumerate(self.Connectors):
            if self.RealConnectors:
                position = self.Extensions[0] + int(round(self.RealConnectors[i] * height))
            else:
                position = self.Extensions[0] + int(round(i * interval))
            if scaling is not None:
                position = round(float(self.Pos.y + position) / float(scaling[1])) * scaling[1] - self.Pos.y
            if self.Type == LEFTRAIL:
                connector.SetPosition(wx.Point(self.Size[0], position))
            elif self.Type == RIGHTRAIL:
                connector.SetPosition(wx.Point(0, position))
        self.RefreshConnected()

    # Refresh the position of wires connected to power rail
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号