451 # Popup the menu with special items for a step |
451 # Popup the menu with special items for a step |
452 self.Parent.PopupDefaultMenu() |
452 self.Parent.PopupDefaultMenu() |
453 |
453 |
454 # Refreshes the step state according to move defined and handle selected |
454 # Refreshes the step state according to move defined and handle selected |
455 def ProcessDragging(self, movex, movey, event, scaling): |
455 def ProcessDragging(self, movex, movey, event, scaling): |
456 handle_type, handle = self.Handle |
456 handle_type, _handle = self.Handle |
457 if handle_type == HANDLE_MOVE: |
457 if handle_type == HANDLE_MOVE: |
458 movex = max(-self.BoundingBox.x, movex) |
458 movex = max(-self.BoundingBox.x, movex) |
459 movey = max(-self.BoundingBox.y, movey) |
459 movey = max(-self.BoundingBox.y, movey) |
460 if scaling is not None: |
460 if scaling is not None: |
461 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
461 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
1586 text_height) |
1586 text_height) |
1587 return text_bbx.InsideXY(pt.x, pt.y) or Graphic_Element.HitTest(self, pt, connectors) |
1587 return text_bbx.InsideXY(pt.x, pt.y) or Graphic_Element.HitTest(self, pt, connectors) |
1588 |
1588 |
1589 # Refresh the jump bounding box |
1589 # Refresh the jump bounding box |
1590 def RefreshBoundingBox(self): |
1590 def RefreshBoundingBox(self): |
1591 text_width, text_height = self.Parent.GetTextExtent(self.Target) |
1591 text_width, _text_height = self.Parent.GetTextExtent(self.Target) |
1592 # Calculate the bounding box size |
1592 # Calculate the bounding box size |
1593 bbx_width = self.Size[0] + 2 + text_width |
1593 bbx_width = self.Size[0] + 2 + text_width |
1594 self.BoundingBox = wx.Rect(self.Pos.x, self.Pos.y - CONNECTOR_SIZE, |
1594 self.BoundingBox = wx.Rect(self.Pos.x, self.Pos.y - CONNECTOR_SIZE, |
1595 bbx_width + 1, self.Size[1] + CONNECTOR_SIZE + 1) |
1595 bbx_width + 1, self.Size[1] + CONNECTOR_SIZE + 1) |
1596 |
1596 |
1950 self.Parent.PopupDefaultMenu() |
1950 self.Parent.PopupDefaultMenu() |
1951 |
1951 |
1952 # Refreshes the action block state according to move defined and handle selected |
1952 # Refreshes the action block state according to move defined and handle selected |
1953 def ProcessDragging(self, movex, movey, event, scaling): |
1953 def ProcessDragging(self, movex, movey, event, scaling): |
1954 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1954 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1955 handle_type, handle = self.Handle |
1955 handle_type, _handle = self.Handle |
1956 if handle_type == HANDLE_MOVE: |
1956 if handle_type == HANDLE_MOVE: |
1957 movex = max(-self.BoundingBox.x, movex) |
1957 movex = max(-self.BoundingBox.x, movex) |
1958 if scaling is not None: |
1958 if scaling is not None: |
1959 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
1959 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
1960 wires = self.Input.GetWires() |
1960 wires = self.Input.GetWires() |