aboutsummaryrefslogtreecommitdiff
path: root/src/sc_editor.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-01-25 23:21:52 +0100
committerThomas White <taw@bitwiz.org.uk>2015-01-25 23:21:52 +0100
commit5a72e79adad04b78400456ff2b85716c7b29c538 (patch)
tree5a51189f6cc5c7e80e58e8e387b907d4283f001c /src/sc_editor.c
parent041764c74cf7528ec2c841ca375b5b5ca3727c64 (diff)
Fixes for pixel-perfect rendering
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r--src/sc_editor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index 7fa8af4..a6515c7 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -428,8 +428,8 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr,
cairo_fill(cr);
/* Get the overall size */
- e->border_offs_x = (width - e->w)/2.0;
- e->border_offs_y = (height - e->h)/2.0;
+ e->border_offs_x = rint((width - e->w)/2.0);
+ e->border_offs_y = rint((height - e->h)/2.0);
if ( e->border_offs_x < e->min_border ) {
e->border_offs_x = e->min_border;
}
@@ -439,8 +439,9 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr,
/* Draw the slide from the cache */
if ( e->surface != NULL ) {
- cairo_set_source_surface(cr, e->surface, e->border_offs_x,
- e->border_offs_y);
+ cairo_set_source_surface(cr, e->surface,
+ rint(e->border_offs_x),
+ rint(e->border_offs_y));
cairo_paint(cr);
} else {
fprintf(stderr, "Current slide not rendered yet!\n");