[mtl renderer] re-introduced end caps

This commit is contained in:
Martin Fouilleul 2023-04-05 10:25:48 +02:00
parent e999af6bd3
commit 4c4f27066b
2 changed files with 3 additions and 4 deletions

View File

@ -126,11 +126,10 @@ int main()
mg_set_color_rgba(0, 0, 1, 1); mg_set_color_rgba(0, 0, 1, 1);
mg_fill(); mg_fill();
*/ */
mg_set_joint(MG_JOINT_NONE);
mg_set_joint(MG_JOINT_MITER);
mg_set_max_joint_excursion(20); mg_set_max_joint_excursion(20);
mg_set_cap(MG_CAP_NONE); mg_set_cap(MG_CAP_SQUARE);
mg_move_to(x+200, y+200); mg_move_to(x+200, y+200);
mg_line_to(x+300, y+300); mg_line_to(x+300, y+300);

View File

@ -532,7 +532,7 @@ u32 mg_mtl_render_stroke_subpath(mg_mtl_encoding_context* context,
{ {
//NOTE(martin): add start and end cap //NOTE(martin): add start and end cap
mg_mtl_stroke_cap(context, startPoint, (vec2){-startTangent.x, -startTangent.y}); mg_mtl_stroke_cap(context, startPoint, (vec2){-startTangent.x, -startTangent.y});
mg_mtl_stroke_cap(context, endPoint, startTangent); mg_mtl_stroke_cap(context, endPoint, endTangent);
} }
return(eltIndex); return(eltIndex);
} }