editors/Viewer.py
changeset 4065 d876242447da
parent 4053 eab8030a510b
equal deleted inserted replaced
4064:f273ee835411 4065:d876242447da
  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,