516 def Resize(self, x, y, width, height): |
516 def Resize(self, x, y, width, height): |
517 self.Move(x, y) |
517 self.Move(x, y) |
518 self.SetSize(width, height) |
518 self.SetSize(width, height) |
519 |
519 |
520 # Refreshes the element state according to move defined and handle selected |
520 # Refreshes the element state according to move defined and handle selected |
521 def ProcessDragging(self, movex, movey, centered, scaling): |
521 def ProcessDragging(self, movex, movey, centered, scaling, width_fac = 1, height_fac = 1): |
522 handle_type, handle = self.Handle |
522 handle_type, handle = self.Handle |
523 # If it is a resize handle, calculate the values from resizing |
523 # If it is a resize handle, calculate the values from resizing |
524 if handle_type == HANDLE_RESIZE: |
524 if handle_type == HANDLE_RESIZE: |
|
525 if scaling is not None: |
|
526 scaling = (scaling[0] * width_fac, scaling[1] * height_fac) |
525 x = y = start_x = start_y = 0 |
527 x = y = start_x = start_y = 0 |
526 width, height = start_width, start_height = self.GetSize() |
528 width, height = start_width, start_height = self.GetSize() |
527 if handle[0] == 1: |
529 if handle[0] == 1: |
528 movex = max(-self.BoundingBox.x, movex) |
530 movex = max(-self.BoundingBox.x, movex) |
529 if scaling is not None: |
531 if scaling is not None: |