Skip to content

Commit

Permalink
Remove temporary workaround from the previous change, now that the is…
Browse files Browse the repository at this point in the history
…sue is solved.

PiperOrigin-RevId: 678325971
  • Loading branch information
Jon T Moran authored and copybara-github committed Oct 2, 2024
1 parent 11abc9c commit 45f4da2
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ink_stroke_modeler/stroke_modeler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,15 @@ void ModelStylus(

absl::Status StrokeModeler::Reset(
const StrokeModelParams &stroke_model_params) {
// TODO: b/368389799 - This is a temporary workaround for a migration problem
// and should be removed.
StrokeModelParams stroke_model_params_copy = stroke_model_params;
StylusStateModelerParams &stylus_modeler_params =
stroke_model_params_copy.stylus_state_modeler_params;
if (stylus_modeler_params.use_stroke_normal_projection) {
if (stylus_modeler_params.min_input_samples < 0) {
stylus_modeler_params.min_input_samples =
stylus_modeler_params.max_input_samples;
}
if (stylus_modeler_params.min_sample_duration < Duration(0)) {
stylus_modeler_params.min_sample_duration = Duration(1e-10);
}
}

if (auto status = ValidateStrokeModelParams(stroke_model_params_copy);
if (auto status = ValidateStrokeModelParams(stroke_model_params);
!status.ok()) {
return status;
}

// Note that many of the sub-modelers require some knowledge about the stroke
// (e.g. start position, input type) when resetting, and as such are reset in
// ProcessTDown() instead.
stroke_model_params_ = stroke_model_params_copy;
stroke_model_params_ = stroke_model_params;
ResetInternal();

const PredictionParams &prediction_params =
Expand Down

0 comments on commit 45f4da2

Please sign in to comment.