evas/vg: fix handling of stroke width in cairo and native backend
T3351 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
dc7806e685
commit
355a4e3830
|
@ -205,7 +205,7 @@ _ector_renderer_cairo_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_Cairo_Sh
|
|||
}
|
||||
|
||||
// Set dash, cap and join
|
||||
cairo_set_line_width(pd->parent->cairo, (pd->public_shape->stroke.width * pd->public_shape->stroke.scale * 2));
|
||||
cairo_set_line_width(pd->parent->cairo, (pd->public_shape->stroke.width * pd->public_shape->stroke.scale));
|
||||
cairo_set_line_cap(pd->parent->cairo, (cairo_line_cap_t) pd->public_shape->stroke.cap);
|
||||
cairo_set_line_join(pd->parent->cairo, (cairo_line_join_t) pd->public_shape->stroke.join);
|
||||
cairo_stroke(pd->parent->cairo);
|
||||
|
|
|
@ -543,9 +543,10 @@ _update_rle(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
|
|||
{
|
||||
ector_software_rasterizer_stroke_set(pd->surface->rasterizer,
|
||||
(pd->public_shape->stroke.width *
|
||||
pd->public_shape->stroke.scale),
|
||||
pd->public_shape->stroke.scale),
|
||||
pd->public_shape->stroke.cap,
|
||||
pd->public_shape->stroke.join);
|
||||
pd->public_shape->stroke.join,
|
||||
pd->base->m);
|
||||
|
||||
if (pd->public_shape->stroke.dash)
|
||||
{
|
||||
|
|
|
@ -108,7 +108,7 @@ void ector_software_rasterizer_init(Software_Rasterizer *rasterizer);
|
|||
void ector_software_rasterizer_done(Software_Rasterizer *rasterizer);
|
||||
|
||||
void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width,
|
||||
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style);
|
||||
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m);
|
||||
|
||||
void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Eina_Matrix3 *t);
|
||||
void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a);
|
||||
|
|
|
@ -365,11 +365,23 @@ void ector_software_rasterizer_done(Software_Rasterizer *rasterizer)
|
|||
}
|
||||
|
||||
void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width,
|
||||
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style)
|
||||
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style,
|
||||
Eina_Matrix3 *m)
|
||||
{
|
||||
SW_FT_Stroker_LineCap cap;
|
||||
SW_FT_Stroker_LineJoin join;
|
||||
int stroke_width = (int)(width * 64);
|
||||
int stroke_width;
|
||||
double scale_factor = 1.0;
|
||||
if (m)
|
||||
{
|
||||
// get the minimum scale factor from matrix
|
||||
scale_factor = m->xx < m->yy ? m->xx : m->yy;
|
||||
}
|
||||
width = width * scale_factor;
|
||||
width = width/2.0; // as free type uses it as the radius of the
|
||||
// pen not the diameter.
|
||||
// convert to freetype co-ordinate
|
||||
stroke_width = (int)(width * 64);
|
||||
|
||||
switch (cap_style)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue