Added OnResizing and OnResized methods, so resize nodes can update effect cache

This commit is contained in:
Jaex 2017-11-14 13:55:05 +03:00
parent 100cc47585
commit 13bf678f63
3 changed files with 22 additions and 1 deletions

View file

@ -155,6 +155,10 @@ public virtual void OnMoving() { }
public virtual void OnMoved() { }
public virtual void OnResizing() { }
public virtual void OnResized() { }
public virtual void OnUpdate()
{
if (Manager.IsCreating)

View file

@ -72,6 +72,16 @@ public override void OnMoved()
CacheEffect();
}
public override void OnResizing()
{
Dispose();
}
public override void OnResized()
{
CacheEffect();
}
private void CacheEffect()
{
Dispose();

View file

@ -1246,11 +1246,18 @@ private void UpdateNodes()
{
if (InputManager.IsMouseDown(MouseButtons.Left))
{
if (!IsResizing)
{
shape.OnResizing();
}
shape.OnNodeUpdate();
}
else
else if (IsResizing)
{
IsResizing = false;
shape.OnResized();
}
shape.OnNodePositionUpdate();