We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 294039f commit c9ae393Copy full SHA for c9ae393
1 file changed
TabletDriverService/TabletFilterNoiseReduction.cpp
@@ -58,6 +58,15 @@ bool TabletFilterNoiseReduction::GetPosition(Vector2D *outputVector) {
58
59
// Update
60
void TabletFilterNoiseReduction::Update() {
61
+
62
+ // One position in the buffer?
63
+ if(bufferPositionCount == 1) {
64
+ position.x = buffer[0].x;
65
+ position.y = buffer[0].y;
66
+ return;
67
+ }
68
69
+ // Calculate geometric median from the buffer positions
70
GetGeometricMedianVector(&position, iterations);
71
72
// Reset the buffer when distance to last target position is larger than the threshold
@@ -72,6 +81,9 @@ void TabletFilterNoiseReduction::Update() {
81
73
82
74
83
84
+//
85
+// Reset buffer
86
75
87
void TabletFilterNoiseReduction::ResetBuffer() {
76
88
bufferPositionCount = 0;
77
89
bufferCurrentIndex = 0;
0 commit comments