|
32 | 32 | #include"ink/strokes/input/stroke_input_batch.h" |
33 | 33 | #include"ink/strokes/internal/stroke_shape_builder.h" |
34 | 34 | #include"ink/strokes/internal/stroke_vertex.h" |
| 35 | +#include"ink/types/duration.h" |
35 | 36 |
|
36 | 37 | namespaceink { |
37 | 38 | namespace { |
@@ -174,7 +175,14 @@ void Stroke::RegenerateShape() { |
174 | 175 | builder.StartStroke(brush_.GetFamily().GetInputModel(), coats[i], |
175 | 176 | brush_.GetSize(), brush_.GetEpsilon(), |
176 | 177 | inputs_.GetNoiseSeed()); |
177 | | - builder.ExtendStroke(inputs_,StrokeInputBatch(), inputs_.GetDuration()); |
| 178 | + |
| 179 | +// A finished stroke has all of its |
| 180 | +// `BrushBehavior::Source::kTimeSinceInputInMillis` and |
| 181 | +// `BrushBehavior::Source::kTimeSinceInputInSeconds` behaviors completed. |
| 182 | +// Passing an infinite duration to `ExtendStroke()` achieves this, in an |
| 183 | +// equivalent but simpler way than looping through each behavior and finding |
| 184 | +// the ones using these sources and getting their maximum range values. |
| 185 | + builder.ExtendStroke(inputs_,StrokeInputBatch(),Duration32::Infinite()); |
178 | 186 |
|
179 | 187 | const MutableMesh& mesh = builder.GetMesh(); |
180 | 188 | shape_gen.custom_packing_arrays.push_back( |
|