fixed #2963: Make sure to set initial size on shape paste so proportional resizing can work

This commit is contained in:
Jaex 2017-12-01 09:33:08 +03:00
parent 69fd80dd76
commit fd5bdaa9ea
2 changed files with 3 additions and 2 deletions

View file

@ -316,7 +316,7 @@ public virtual void OnNodeUpdate()
StartPosition = startPos;
EndPosition = endPos;
if (Manager.IsProportionalResizing)
if (Manager.IsProportionalResizing && !InitialSize.IsEmpty)
{
switch (nodePosition)
{

View file

@ -757,7 +757,6 @@ private void EndRegionSelection()
if (wasCreating)
{
shape.OnCreated();
shape.InitialSize = shape.Rectangle.Size;
OnShapeCreated(shape);
}
@ -1313,6 +1312,7 @@ private void PasteFromClipboard()
Point pos = InputManager.ClientMousePosition;
shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1);
shape.SetImage(img, true);
shape.OnCreated();
AddShape(shape);
SelectCurrentShape();
}
@ -1329,6 +1329,7 @@ private void PasteFromClipboard()
shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1);
shape.Text = text.Trim();
shape.AutoSize(true);
shape.OnCreated();
AddShape(shape);
SelectCurrentShape();
}