summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-07-22 06:35:48 +0200
committerTimm Bäder <mail@baedert.org>2020-07-28 05:34:11 +0200
commitfcf502a6869d083d09f6b7a95119d7f031c1d4e8 (patch)
tree6c9f4dfd588cc9f653040e9d23029708218645dc /gsk
parent36689d188443934671bdc80b9b57394c7fe7c9ac (diff)
downloadgtk+-fcf502a6869d083d09f6b7a95119d7f031c1d4e8.tar.gz
gl renderer: Fix scrolledwindow undershoot rendering
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gl/gskglrenderer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 9df466a248..87774796ce 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -535,8 +535,8 @@ render_fallback_node (GskGLRenderer *self,
RenderOpBuilder *builder)
{
const float scale = ops_get_scale (builder);
- const int surface_width = ceilf (node->bounds.size.width) * scale;
- const int surface_height = ceilf (node->bounds.size.height) * scale;
+ const int surface_width = ceilf (node->bounds.size.width * scale);
+ const int surface_height = ceilf (node->bounds.size.height * scale);
cairo_surface_t *surface;
cairo_surface_t *rendered_surface;
cairo_t *cr;
@@ -570,7 +570,7 @@ render_fallback_node (GskGLRenderer *self,
cr = cairo_create (rendered_surface);
cairo_save (cr);
- cairo_translate (cr, -node->bounds.origin.x, -node->bounds.origin.y);
+ cairo_translate (cr, - floorf (node->bounds.origin.x), - floorf (node->bounds.origin.y));
gsk_render_node_draw (node, cr);
cairo_restore (cr);
cairo_destroy (cr);
@@ -585,7 +585,7 @@ render_fallback_node (GskGLRenderer *self,
/* We draw upside down here, so it matches what GL does. */
cairo_save (cr);
cairo_scale (cr, 1, -1);
- cairo_translate (cr, 0, -surface_height / scale);
+ cairo_translate (cr, 0, - surface_height / scale);
cairo_set_source_surface (cr, rendered_surface, 0, 0);
cairo_rectangle (cr, 0, 0, surface_width / scale, surface_height / scale);
cairo_fill (cr);