graphics/LD_Objects.py
changeset 554 08c26c62f5a7
parent 550 cfa295862d55
child 563 3f92a5e18804
equal deleted inserted replaced
553:1e1b632c7a41 554:08c26c62f5a7
   306             if scaling is not None:
   306             if scaling is not None:
   307                 position = handle.GetRelPosition()
   307                 position = handle.GetRelPosition()
   308                 movey = round(float(self.Pos.y + position.y + movey) / float(scaling[1])) * scaling[1] - self.Pos.y - position.y
   308                 movey = round(float(self.Pos.y + position.y + movey) / float(scaling[1])) * scaling[1] - self.Pos.y - position.y
   309             self.MoveConnector(handle, movey)
   309             self.MoveConnector(handle, movey)
   310             return 0, movey
   310             return 0, movey
   311         else:
   311         elif self.Parent.GetDrawingMode() == FREEDRAWING_MODE:
   312             return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling)
   312             return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling)
       
   313         return 0, 0
   313     
   314     
   314     # Refreshes the power rail model
   315     # Refreshes the power rail model
   315     def RefreshModel(self, move=True):
   316     def RefreshModel(self, move=True):
   316         self.Parent.RefreshPowerRailModel(self)
   317         self.Parent.RefreshPowerRailModel(self)
   317         # If power rail has moved and power rail is of type LEFT, refresh the model 
   318         # If power rail has moved and power rail is of type LEFT, refresh the model 
   437             if self.Output.IsConnected():
   438             if self.Output.IsConnected():
   438                 rect = rect.Union(self.Output.GetConnectedRedrawRect(movex, movey))
   439                 rect = rect.Union(self.Output.GetConnectedRedrawRect(movex, movey))
   439         return rect
   440         return rect
   440 
   441 
   441     def ProcessDragging(self, movex, movey, event, scaling):
   442     def ProcessDragging(self, movex, movey, event, scaling):
       
   443         if self.Parent.GetDrawingMode() != FREEDRAWING_MODE:
       
   444             movex = movey = 0
   442         return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, height_fac = 2)
   445         return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, height_fac = 2)
   443     
   446     
   444     # Forbids to change the contact size
   447     # Forbids to change the contact size
   445     def SetSize(self, width, height):
   448     def SetSize(self, width, height):
   446         if self.Parent.GetDrawingMode() == FREEDRAWING_MODE:
   449         if self.Parent.GetDrawingMode() == FREEDRAWING_MODE:
   716             if self.Output.IsConnected():
   719             if self.Output.IsConnected():
   717                 rect = rect.Union(self.Output.GetConnectedRedrawRect(movex, movey))
   720                 rect = rect.Union(self.Output.GetConnectedRedrawRect(movex, movey))
   718         return rect
   721         return rect
   719     
   722     
   720     def ProcessDragging(self, movex, movey, event, scaling):
   723     def ProcessDragging(self, movex, movey, event, scaling):
       
   724         if self.Parent.GetDrawingMode() != FREEDRAWING_MODE:
       
   725             movex = movey = 0
   721         return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, height_fac = 2)    
   726         return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, height_fac = 2)    
   722     
   727     
   723     # Forbids to change the Coil size
   728     # Forbids to change the Coil size
   724     def SetSize(self, width, height):
   729     def SetSize(self, width, height):
   725         if self.Parent.GetDrawingMode() == FREEDRAWING_MODE:
   730         if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: