graphics/GraphicCommons.py
changeset 1120 35d772ec1a76
parent 1102 cd4a996ddaa7
child 1166 2ed9675be08d
equal deleted inserted replaced
1119:34db4294c177 1120:35d772ec1a76
  2045         return rect
  2045         return rect
  2046     
  2046     
  2047     def Clone(self, parent, connectors = {}, dx = 0, dy = 0):
  2047     def Clone(self, parent, connectors = {}, dx = 0, dy = 0):
  2048         start_connector = connectors.get(self.StartConnected, None)
  2048         start_connector = connectors.get(self.StartConnected, None)
  2049         end_connector = connectors.get(self.EndConnected, None)
  2049         end_connector = connectors.get(self.EndConnected, None)
  2050         print self.StartConnected, "=>", start_connector, ",", self.EndConnected, "=>", end_connector
       
  2051         if start_connector is not None and end_connector is not None:
  2050         if start_connector is not None and end_connector is not None:
  2052             wire = Wire(parent)
  2051             wire = Wire(parent)
  2053             wire.SetPoints([(point.x + dx, point.y + dy) for point in self.Points])
  2052             wire.SetPoints([(point.x + dx, point.y + dy) for point in self.Points])
  2054             start_connector.Connect((wire, 0), False)
  2053             start_connector.Connect((wire, 0), False)
  2055             end_connector.Connect((wire, -1), False)
  2054             end_connector.Connect((wire, -1), False)