[gtk+] rendernode: Transform cairo_t to correct coordinates



commit b3e5c31b080b682d479ab15efc80075fc53afe7e
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 1 03:42:35 2016 +0100

    rendernode: Transform cairo_t to correct coordinates
    
    We want to have the coordinate system of the created cairo surface to be
    identical to the coordinate system of the node's bounds. For that, we
    need to translate the cairo surface by the bounds' origin.

 gsk/gskrendernode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index 85cf246..adca902 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -1424,6 +1424,8 @@ gsk_render_node_get_draw_context (GskRenderNode *node)
 
   res = cairo_create (node->surface);
 
+  cairo_translate (res, -node->bounds.origin.x, -node->bounds.origin.y);
+
   cairo_rectangle (res,
                    node->bounds.origin.x, node->bounds.origin.y,
                    node->bounds.size.width, node->bounds.size.height);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]