diff options
author | Subhransu Mohanty <sub.mohanty@samsung.com> | 2015-04-03 16:34:16 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-04-03 16:34:16 +0200 |
commit | b20872bf68378807e62d14939777ed912bf4bc89 (patch) | |
tree | 2972edcff215222efb450869a62579c92589e0f7 | |
parent | 1c093f3660aa8c9ddff4e795ca6a7c73cbdfa1bc (diff) | |
download | efl-b20872bf68378807e62d14939777ed912bf4bc89.tar.gz |
ector: add cairo_save() and cairo_restore() to fix the transformation issue.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r-- | src/lib/ector/cairo/ector_renderer_cairo_base.c | 4 | ||||
-rw-r--r-- | src/lib/ector/cairo/ector_renderer_cairo_shape.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_base.c b/src/lib/ector/cairo/ector_renderer_cairo_base.c index fad9016244..bb4aa1f607 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_base.c +++ b/src/lib/ector/cairo/ector_renderer_cairo_base.c @@ -170,10 +170,12 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj, cairo_set_operator(pd->parent->cairo, cop); cairo_transform(pd->parent->cairo, &identity); - if (pd->m) cairo_transform(pd->parent->cairo, pd->m); cx = pd->generic->origin.x - pd->parent->current.x; cy = pd->generic->origin.y - pd->parent->current.y; cairo_translate(pd->parent->cairo, cx, cy); + + if (pd->m) cairo_transform(pd->parent->cairo, pd->m); + pd->parent->current.x = pd->generic->origin.x; pd->parent->current.y = pd->generic->origin.y; diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c index b064a5a18c..4e705d9d0b 100644 --- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c +++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c @@ -42,6 +42,9 @@ static void (*cairo_set_line_width)(cairo_t *cr, double width) = NULL; static void (*cairo_set_line_cap)(cairo_t *cr, cairo_line_cap_t line_cap) = NULL; static void (*cairo_set_line_join)(cairo_t *cr, cairo_line_join_t line_join) = NULL; +static void (*cairo_save)(cairo_t *cr) = NULL; +static void (*cairo_restore)(cairo_t *cr) = NULL; + typedef struct _Ector_Renderer_Cairo_Shape_Data Ector_Renderer_Cairo_Shape_Data; struct _Ector_Renderer_Cairo_Shape_Data { @@ -152,6 +155,9 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Rend int r, g, b, a; if (pd->path == NULL) return EINA_FALSE; + USE(obj, cairo_save, EINA_FALSE); + cairo_save(pd->parent->cairo); + eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, ector_renderer_draw(op, clips, mul_col)); USE(obj, cairo_new_path, EINA_FALSE); @@ -198,6 +204,8 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Rend cairo_fill(pd->parent->cairo); } + USE(obj, cairo_restore, EINA_FALSE); + cairo_restore(pd->parent->cairo); return EINA_TRUE; } |