Set Target to Min/Max value when progress is lower
This commit is contained in:
Родитель
3bac691e49
Коммит
f5dc75e72b
|
@ -36,11 +36,15 @@
|
|||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (Progress < Minimum)
|
||||
if (Progress < Minimum) {
|
||||
Target.SetValue(TargetProperty, From * MultiplyValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Progress >= Maximum)
|
||||
if (Progress >= Maximum) {
|
||||
Target.SetValue(TargetProperty, To * MultiplyValue);
|
||||
return;
|
||||
}
|
||||
|
||||
//Formula Used
|
||||
//Y = ((X - X1)*(Y2 - Y1) / (X2 - X1)) + Y1
|
||||
|
|
|
@ -26,11 +26,15 @@
|
|||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (Progress < Minimum)
|
||||
if (Progress < Minimum) {
|
||||
Target.SetValue(TargetProperty, From);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Progress >= Maximum)
|
||||
if (Progress >= Maximum) {
|
||||
Target.SetValue(TargetProperty, To);
|
||||
return;
|
||||
}
|
||||
|
||||
int? value = (int)(((Progress - Minimum) * (To - From) / (Maximum - Minimum)) + From);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче