mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 01:37:31 +13:00
Added OnResizing and OnResized methods, so resize nodes can update effect cache
This commit is contained in:
parent
100cc47585
commit
13bf678f63
3 changed files with 22 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -72,6 +72,16 @@ public override void OnMoved()
|
|||
CacheEffect();
|
||||
}
|
||||
|
||||
public override void OnResizing()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public override void OnResized()
|
||||
{
|
||||
CacheEffect();
|
||||
}
|
||||
|
||||
private void CacheEffect()
|
||||
{
|
||||
Dispose();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue