Handle FT_STROKER_LINECAP_BUTT.

This fixes Savannah bug #26757.

* src/base/ftstroke.c (ft_stroker_cap): Implement it.
This commit is contained in:
Michael Zucchi 2009-06-08 17:12:40 +02:00 committed by Werner Lemberg
parent c6788a389d
commit f33b237c96
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2009-06-08 Michael Zucchi <notzed@gmail.com>
Handle FT_STROKER_LINECAP_BUTT.
This fixes Savannah bug #26757.
* src/base/ftstroke.c (ft_stroker_cap): Implement it.
2009-06-07 Harald Fernengel <harry@kdevelop.org>
Fix some potential out-of-memory crashes.

View File

@ -859,6 +859,31 @@
error = ft_stroke_border_lineto( border, &delta, FALSE );
}
else if ( stroker->line_cap == FT_STROKER_LINECAP_BUTT )
{
/* add a butt ending */
FT_Vector delta;
FT_Angle rotate = FT_SIDE_TO_ROTATE( side );
FT_Fixed radius = stroker->radius;
FT_StrokeBorder border = stroker->borders + side;
FT_Vector_From_Polar( &delta, radius, angle + rotate );
delta.x += stroker->center.x;
delta.y += stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, FALSE );
if ( error )
goto Exit;
FT_Vector_From_Polar( &delta, radius, angle - rotate );
delta.x += stroker->center.x;
delta.y += stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, FALSE );
}
Exit:
return error;