ector: fix transform issue in cairo backend.
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Fri, 3 Apr 2015 14:34:19 +0000 (16:34 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:34:19 +0000 (16:34 +0200)
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/ector/cairo/ector_cairo_surface.c
src/lib/ector/cairo/ector_renderer_cairo_base.c

index 8875c04..377fbbd 100644 (file)
@@ -73,7 +73,6 @@ _ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
 
 typedef struct _cairo_surface_t cairo_surface_t;
 
-static void (*cairo_translate)(cairo_t *cr, double tx, double ty) = NULL;
 static void (*cairo_destroy)(cairo_t *cr) = NULL;
 static cairo_surface_t *(*cairo_image_surface_create)(int format,
                                                       int width,
@@ -118,11 +117,8 @@ _ector_cairo_surface_ector_generic_surface_reference_point_set(Eo *obj EINA_UNUS
                                                                Ector_Cairo_Surface_Data *pd,
                                                                int x, int y)
 {
-   if (pd->cairo)
-     {
-        USE(obj, cairo_translate, );
-        cairo_translate(pd->cairo, x, y);
-     }
+   pd->current.x = x;
+   pd->current.y = y;
 }
 
 static void
index bb4aa1f..5a51aae 100644 (file)
@@ -170,15 +170,13 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
 
    cairo_set_operator(pd->parent->cairo, cop);
    cairo_transform(pd->parent->cairo, &identity);
-   cx = pd->generic->origin.x - pd->parent->current.x;
-   cy = pd->generic->origin.y - pd->parent->current.y;
+   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;
-
    cairo_set_source_rgba(pd->parent->cairo, r/255.0, g/255.0, b/255.0, a/255.0);
 
    USE(obj, cairo_new_path, EINA_FALSE);