2536 # Model adding functions |
2536 # Model adding functions |
2537 # ------------------------------------------------------------------------------- |
2537 # ------------------------------------------------------------------------------- |
2538 |
2538 |
2539 def GetScaledSize(self, width, height): |
2539 def GetScaledSize(self, width, height): |
2540 if self.Scaling is not None: |
2540 if self.Scaling is not None: |
2541 width = round(width / self.Scaling[0] + 0.4) * self.Scaling[0] |
2541 width = round((width / self.Scaling[0] + 0.4) * self.Scaling[0]) |
2542 height = round(height / self.Scaling[1] + 0.4) * self.Scaling[1] |
2542 height = round((height / self.Scaling[1] + 0.4) * self.Scaling[1]) |
2543 return width, height |
2543 return width, height |
2544 |
2544 |
2545 def AddNewElement(self, element, bbox, wire=None, connector=None): |
2545 def AddNewElement(self, element, bbox, wire=None, connector=None): |
2546 min_width, min_height = (element.GetMinSize(True) |
2546 min_width, min_height = (element.GetMinSize(True) |
2547 if isinstance(element, (LD_PowerRail, |
2547 if isinstance(element, (LD_PowerRail, |