From b3e5c31b080b682d479ab15efc80075fc53afe7e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 1 Nov 2016 03:42:35 +0100 Subject: [PATCH] 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 file changed, 2 insertions(+) diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c index 85cf2466a6..adca902deb 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);