public virtual void DoResize(DiagramView view, RectangleF origRect, PointF newPoint, int whichHandle, InputState evttype, SizeF min, SizeF max) { if (evttype == InputState.Cancel) { this.Bounds = origRect; } else { RectangleF ef1 = this.ComputeResize(origRect, newPoint, whichHandle, min, max, this.CanReshape() && !view.LastInput.Shift); if (this.ResizesRealtime) { this.Bounds = ef1; } else { Rectangle rectangle1 = view.ConvertDocToView(ef1); view.DrawXorBox(rectangle1, evttype != InputState.Finish); if (evttype == InputState.Finish) { this.Bounds = ef1; } } } }
public override void DoResize(DiagramView view, RectangleF origRect, PointF newPoint, int whichHandle, InputState evttype, SizeF min, SizeF max) { SizeF ef2; SizeF ef3; RectangleF ef4; RectangleF ef1 = this.ComputeBounds(); if (this.IsExpanded) { ef2 = this.TopLeftMargin; ef3 = this.BottomRightMargin; } else { ef2 = this.CollapsedTopLeftMargin; ef3 = this.CollapsedBottomRightMargin; } ef1.X += ef2.Width; ef1.Y += ef2.Height; ef1.Width -= (ef2.Width + ef3.Width); ef1.Height -= (ef2.Height + ef3.Height); if (evttype == InputState.Cancel) { ef4 = origRect; } else { ef4 = this.ComputeResize(origRect, newPoint, whichHandle, new SizeF(ef1.Width, ef1.Height), max, true); } if (this.ResizesRealtime || (evttype == InputState.Cancel)) { SizeF ef5 = new SizeF(System.Math.Max((float)0f, (float)(ef4.Right - ef1.Right)), System.Math.Max((float)0f, (float)(ef4.Bottom - ef1.Bottom))); SizeF ef6 = new SizeF(System.Math.Max((float)0f, (float)(ef1.X - ef4.X)), System.Math.Max((float)0f, (float)(ef1.Y - ef4.Y))); if (this.IsExpanded) { this.BottomRightMargin = ef5; this.TopLeftMargin = ef6; } else { this.CollapsedBottomRightMargin = ef5; this.CollapsedTopLeftMargin = ef6; } } else { Rectangle rectangle1 = view.ConvertDocToView(ef4); view.DrawXorBox(rectangle1, evttype != InputState.Finish); if (evttype == InputState.Finish) { SizeF ef7 = new SizeF(System.Math.Max((float)0f, (float)(ef4.Right - ef1.Right)), System.Math.Max((float)0f, (float)(ef4.Bottom - ef1.Bottom))); SizeF ef8 = new SizeF(System.Math.Max((float)0f, (float)(ef1.X - ef4.X)), System.Math.Max((float)0f, (float)(ef1.Y - ef4.Y))); if (this.IsExpanded) { this.BottomRightMargin = ef7; this.TopLeftMargin = ef8; } else { this.CollapsedBottomRightMargin = ef7; this.CollapsedTopLeftMargin = ef8; } } } }