Skip to content

Commit 04cb617

Browse files
committed
Update Smoothing property default value
1 parent fc3585e commit 04cb617

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

BezierInterpolator/BezierInterp.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ public override void UpdateState(SyntheticTabletReport report)
3636
target = Vector3.Lerp(controlPoint, controlPointNext, 0.5f);
3737
}
3838

39-
[SliderProperty("Pre-interpolation smoothing factor", 0.01f, 1.0f, 1.0f), ToolTip
39+
[Property("Pre-interpolation smoothing factor"), DefaultPropertyValue(1.0f), ToolTip
4040
(
41-
"Sets the factor of pre-interpolation simple exponential smoothing (Aka EMA weight).\n\n" +
41+
"Sets the factor of pre-interpolation simple exponential smoothing (aka EMA weight).\n\n" +
4242
"Possible values are 0.01 .. 1\n" +
4343
"Factor of 1 means no smoothing is applied,\n" +
4444
"smaller values add smoothing."
4545
)]
46-
public float emaWeight { get; set; } = 1;
46+
public float SmoothingFactor
47+
{
48+
get { return emaWeight; }
49+
set { emaWeight = System.Math.Clamp(value, 0.0f, 1.0f); }
50+
}
51+
private float emaWeight;
4752

4853
private SyntheticTabletReport SyntheticReport;
4954
private Vector2 emaTarget;

0 commit comments

Comments
 (0)