public override void startResize() { base.startResize(); Common.history.drawWithoutNow(); Common.history.update(); int x1 = 100000, x2 = -1, y1 = 100000, y2 = -1; for (int i = 0; i < pointList.Count; ++i) { x1 = x1 < pointList[i].X ? x1 : pointList[i].X; y1 = y1 < pointList[i].Y ? y1 : pointList[i].Y; x2 = x2 > pointList[i].X ? x2 : pointList[i].X; y2 = y2 > pointList[i].Y ? y2 : pointList[i].Y; } Rectangle r = new Rectangle(x1, y1, x2 - x1, y2 - y1); resizeRectangle = new ResizeRectangle(Common.mainPicture, r); resizeRectangle.rbResizeButton.MouseDown += RB_MD; resizeRectangle.rbResizeButton.MouseMove += RB_MM; resizeRectangle.rbResizeButton.MouseUp += RB_MU; }
private void BorderOnLeftButtonUp(object sender, MouseButtonEventArgs e) { _isDragging = false; ResizeRectangle.ReleaseMouseCapture(); }
private void BorderOnLeftButtonDown(object sender, MouseButtonEventArgs e) { _isDragging = true; _startPoint = e.GetPosition(this); ResizeRectangle.CaptureMouse(); }