495 height -= movey |
495 height -= movey |
496 elif handle[1] == 3: |
496 elif handle[1] == 3: |
497 height += movey |
497 height += movey |
498 # Verify that new size is not lesser than minimum |
498 # Verify that new size is not lesser than minimum |
499 min_width, min_height = self.GetMinSize() |
499 min_width, min_height = self.GetMinSize() |
500 if width >= min_width and height >= min_height: |
500 if width >= min_width and height >= min_height or width >= self.Size[0] and height >= self.Size[1]: |
501 self.Resize(x, y, width, height) |
501 self.Resize(x, y, width, height) |
502 # If it is a move handle, Move this element |
502 # If it is a move handle, Move this element |
503 elif handle_type == HANDLE_MOVE: |
503 elif handle_type == HANDLE_MOVE: |
504 self.Move(movex, movey) |
504 self.Move(movex, movey) |
505 |
505 |
1101 if len(self.Points) > 1: |
1101 if len(self.Points) > 1: |
1102 minx, minbbxx = min(minx, self.Points[-1].x), min(minbbxx, self.Points[-1].x - end_radius) |
1102 minx, minbbxx = min(minx, self.Points[-1].x), min(minbbxx, self.Points[-1].x - end_radius) |
1103 maxx, maxbbxx = max(maxx, self.Points[-1].x), max(maxbbxx, self.Points[-1].x + end_radius) |
1103 maxx, maxbbxx = max(maxx, self.Points[-1].x), max(maxbbxx, self.Points[-1].x + end_radius) |
1104 miny, minbbxy = min(miny, self.Points[-1].y), min(minbbxy, self.Points[-1].y - end_radius) |
1104 miny, minbbxy = min(miny, self.Points[-1].y), min(minbbxy, self.Points[-1].y - end_radius) |
1105 maxy, maxbbxy = max(maxy, self.Points[-1].y), max(maxbbxy, self.Points[-1].y + end_radius) |
1105 maxy, maxbbxy = max(maxy, self.Points[-1].y), max(maxbbxy, self.Points[-1].y + end_radius) |
1106 self.Pos = wx.Point(minx, miny) |
1106 self.Pos.x, self.Pos.y = minx, miny |
1107 self.Size = wx.Size(maxx -minx + 1, maxy - miny + 1) |
1107 self.Size = wx.Size(maxx - minx + 1, maxy - miny + 1) |
1108 self.BoundingBox = wx.Rect(minbbxx, minbbxy, maxbbxx - minbbxx + 1, maxbbxy - minbbxy + 1) |
1108 self.BoundingBox = wx.Rect(minbbxx, minbbxy, maxbbxx - minbbxx + 1, maxbbxy - minbbxy + 1) |
1109 |
1109 |
1110 # Refresh the realpoints that permits to keep the proportionality in wire during resizing |
1110 # Refresh the realpoints that permits to keep the proportionality in wire during resizing |
1111 def RefreshRealPoints(self): |
1111 def RefreshRealPoints(self): |
1112 if len(self.Points) > 0: |
1112 if len(self.Points) > 0: |