Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec1810b

Browse files
Ink Open Sourcecopybara-github
Ink Open Source
authored andcommitted
Ink: Fix support for brushes that make stroke content disappear by the end
PiperOrigin-RevId: 785867891
1 parent5c8228c commitec1810b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎ink/strokes/stroke.cc‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include"ink/strokes/input/stroke_input_batch.h"
3333
#include"ink/strokes/internal/stroke_shape_builder.h"
3434
#include"ink/strokes/internal/stroke_vertex.h"
35+
#include"ink/types/duration.h"
3536

3637
namespaceink {
3738
namespace {
@@ -174,7 +175,14 @@ void Stroke::RegenerateShape() {
174175
builder.StartStroke(brush_.GetFamily().GetInputModel(), coats[i],
175176
brush_.GetSize(), brush_.GetEpsilon(),
176177
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());
178186

179187
const MutableMesh& mesh = builder.GetMesh();
180188
shape_gen.custom_packing_arrays.push_back(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp