@@ -79,7 +79,11 @@ static VertexBuffer CreateSolidStrokeVertices(
7979 vtx.vertex_normal = {};
8080 vtx.pen_down = 0.0 ;
8181 vtx_builder.AppendVertex (vtx);
82+
8283 vtx.vertex_position = polyline.points [contour_start_point_i];
84+ // Append two transparent vertices at the beginning of the new contour
85+ // because it's a triangle strip.
86+ vtx_builder.AppendVertex (vtx);
8387 vtx_builder.AppendVertex (vtx);
8488 }
8589
@@ -152,9 +156,13 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
152156 cmd.pipeline =
153157 renderer.GetSolidStrokePipeline (OptionsFromPassAndEntity (pass, entity));
154158 cmd.stencil_reference = entity.GetStencilDepth ();
159+
160+ auto smoothing = SmoothingApproximation (
161+ 5.0 / (stroke_size_ * entity.GetTransformation ().GetMaxBasisLength ()),
162+ 0.0 , 0.0 );
155163 cmd.BindVertices (CreateSolidStrokeVertices (
156164 entity.GetPath (), pass.GetTransientsBuffer (), cap_proc_, join_proc_,
157- miter_limit_, arc_smoothing_approximation_ ));
165+ miter_limit_, smoothing ));
158166 VS::BindFrameInfo (cmd, pass.GetTransientsBuffer ().EmplaceUniform (frame_info));
159167 VS::BindStrokeInfo (cmd,
160168 pass.GetTransientsBuffer ().EmplaceUniform (stroke_info));
@@ -166,7 +174,6 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
166174
167175void SolidStrokeContents::SetStrokeSize (Scalar size) {
168176 stroke_size_ = size;
169- arc_smoothing_approximation_ = SmoothingApproximation (5.0 / size, 0.0 , 0.0 );
170177}
171178
172179Scalar SolidStrokeContents::GetStrokeSize () const {
0 commit comments