summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_vg_container.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-10 12:22:26 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-10 12:22:26 +0100
commiteae18be54a81ec7b405dc244f64177cc8a1054c0 (patch)
tree97548ef39b5a4f9839fa717975e676fa475368d3 /src/lib/evas/canvas/efl_canvas_vg_container.c
parentb159df022ae0edb62cf183e350e4f60e2a1c5a77 (diff)
evas vg - don't make bounds 0 sized ... which leads to no rendering
@fix
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_container.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c
index 4ba1d96bfe..76a67f4eee 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_container.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_container.c
@@ -290,44 +290,42 @@ _efl_canvas_vg_container_efl_gfx_path_bounds_get(const Eo *obj EINA_UNUSED,
290 { 290 {
291 Eina_Position2D pos = efl_gfx_entity_position_get(child); 291 Eina_Position2D pos = efl_gfx_entity_position_get(child);
292 double miterlimit = 0.0, stroke_gap = 0.0; 292 double miterlimit = 0.0, stroke_gap = 0.0;
293 int stroke_gap_int;
294
293 if (efl_isa(child, EFL_CANVAS_VG_SHAPE_CLASS)) 295 if (efl_isa(child, EFL_CANVAS_VG_SHAPE_CLASS))
294 { 296 {
295 miterlimit = efl_gfx_shape_stroke_miterlimit_get(child); 297 miterlimit = efl_gfx_shape_stroke_miterlimit_get(child);
296 stroke_gap = efl_gfx_shape_stroke_width_get(child) * (miterlimit <= 0 ? 1 : miterlimit); 298 stroke_gap = efl_gfx_shape_stroke_width_get(child) * (miterlimit <= 0 ? 1 : miterlimit);
297 } 299 }
300 // convert stroke_gap to an int and round it up to the
301 stroke_gap_int = 2 * ((stroke_gap + 1.0000) / 2);
298 if (first) 302 if (first)
299 { 303 {
300 efl_gfx_path_bounds_get(child, r); 304 efl_gfx_path_bounds_get(child, r);
301 if (r->size.w != 0 && r->size.h != 0) 305 r->pos.x += pos.x;
306 r->pos.y += pos.y;
307 if (stroke_gap_int > 0)
302 { 308 {
303 r->pos.x += pos.x; 309 r->pos.x -= stroke_gap_int / 2;
304 r->pos.y += pos.y; 310 r->pos.y -= stroke_gap_int / 2;
305 if (stroke_gap > 1.0) 311 r->size.w += stroke_gap_int;
306 { 312 r->size.h += stroke_gap_int;
307 r->pos.x -= (int)(stroke_gap/2.0);
308 r->pos.y -= (int)(stroke_gap/2.0);
309 r->size.w += (int)(stroke_gap);
310 r->size.h += (int)(stroke_gap);
311 }
312 first = EINA_FALSE;
313 } 313 }
314 first = EINA_FALSE;
314 } 315 }
315 else 316 else
316 { 317 {
317 efl_gfx_path_bounds_get(child, &s); 318 efl_gfx_path_bounds_get(child, &s);
318 if (s.size.w != 0 && s.size.h != 0) 319 s.pos.x += pos.x;
320 s.pos.y += pos.y;
321 if (stroke_gap_int > 0)
319 { 322 {
320 s.pos.x += pos.x; 323 s.pos.x -= stroke_gap_int / 2;
321 s.pos.y += pos.y; 324 s.pos.y -= stroke_gap_int / 2;
322 if (stroke_gap > 1.0) 325 s.size.w += stroke_gap_int;
323 { 326 s.size.h += stroke_gap_int;
324 s.pos.x -= (int)(stroke_gap/2.0);
325 s.pos.y -= (int)(stroke_gap/2.0);
326 s.size.w += (int)(stroke_gap);
327 s.size.h += (int)(stroke_gap);
328 }
329 eina_rectangle_union(&r->rect, &s.rect);
330 } 327 }
328 eina_rectangle_union(&r->rect, &s.rect);
331 } 329 }
332 } 330 }
333} 331}