mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Changes for the animation after discussions with Thomas. Mainly that the animation of the interactive capture STARTS from the Mouse-Cursor outwards.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2348 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
03cba68f61
commit
672590cd3b
2 changed files with 45 additions and 26 deletions
|
@ -36,7 +36,24 @@ namespace Greenshot.Helpers {
|
|||
protected Queue<T> queue = new Queue<T>();
|
||||
protected double frames;
|
||||
protected double currentFrame = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="first"></param>
|
||||
/// <param name="last"></param>
|
||||
/// <param name="frames"></param>
|
||||
/// <param name="easingType"></param>
|
||||
/// <param name="easingMode"></param>
|
||||
public AnimatorBase(T first, T last, int frames, EasingType easingType, EasingMode easingMode) {
|
||||
this.first = first;
|
||||
this.last = last;
|
||||
this.frames = frames;
|
||||
this.current = first;
|
||||
this.EasingType = easingType;
|
||||
this.EasingMode = easingMode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The amount of frames
|
||||
/// </summary>
|
||||
|
@ -59,11 +76,23 @@ namespace Greenshot.Helpers {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Last animation value
|
||||
/// Last animation value, of this "leg"
|
||||
/// </summary>
|
||||
public T Last {
|
||||
get { return last; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Final animation value, this is including the legs
|
||||
/// </summary>
|
||||
public T Final {
|
||||
get {
|
||||
if (queue.Count == 0) {
|
||||
return last;
|
||||
}
|
||||
return queue.ToArray()[queue.Count - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This restarts the current animation and changes the last frame
|
||||
|
@ -83,13 +112,14 @@ namespace Greenshot.Helpers {
|
|||
this.currentFrame = 0;
|
||||
this.frames = frames;
|
||||
this.last = newDestination;
|
||||
queue.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queue the destination, it will be used after the current animation is finished
|
||||
/// </summary>
|
||||
/// <param name="queuedDestination"></param>
|
||||
public void QueueDestination(T queuedDestination) {
|
||||
public void QueueDestinationLeg(T queuedDestination) {
|
||||
queue.Enqueue(queuedDestination);
|
||||
}
|
||||
|
||||
|
@ -126,23 +156,6 @@ namespace Greenshot.Helpers {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="first"></param>
|
||||
/// <param name="last"></param>
|
||||
/// <param name="frames"></param>
|
||||
/// <param name="easingType"></param>
|
||||
/// <param name="easingMode"></param>
|
||||
public AnimatorBase(T first, T last, int frames, EasingType easingType, EasingMode easingMode) {
|
||||
this.first = first;
|
||||
this.last = last;
|
||||
this.frames = frames;
|
||||
this.current = first;
|
||||
this.EasingType = easingType;
|
||||
this.EasingMode = easingMode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current (previous) frame object
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue