aboutsummaryrefslogtreecommitdiff
path: root/ink_stroke_modeler/internal/prediction/kalman_predictor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ink_stroke_modeler/internal/prediction/kalman_predictor.cc')
-rw-r--r--ink_stroke_modeler/internal/prediction/kalman_predictor.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ink_stroke_modeler/internal/prediction/kalman_predictor.cc b/ink_stroke_modeler/internal/prediction/kalman_predictor.cc
index ba202dc..ab24540 100644
--- a/ink_stroke_modeler/internal/prediction/kalman_predictor.cc
+++ b/ink_stroke_modeler/internal/prediction/kalman_predictor.cc
@@ -57,7 +57,8 @@ void KalmanPredictor::Reset() {
void KalmanPredictor::Update(Vec2 position, Time time) {
last_position_received_ = position;
sample_times_.push_back(time);
- if (sample_times_.size() > predictor_params_.max_time_samples)
+ if (predictor_params_.max_time_samples < 0 ||
+ sample_times_.size() > (uint)predictor_params_.max_time_samples)
sample_times_.pop_front();
x_predictor_.Update(position.x);