[Xfce4-commits] <ristretto:master> Round rendering of image to whole pixels (Bug #8317)
Stephan Arts
noreply at xfce.org
Thu Jan 26 07:56:01 CET 2012
Updating branch refs/heads/master
to 98d7583237987d53ccb99f6e798f5c2602bdfba5 (commit)
from e3c3ad95b1c5e9fc845ad21d16a52546b944aef4 (commit)
commit 98d7583237987d53ccb99f6e798f5c2602bdfba5
Author: Stephan Arts <stephan at xfce.org>
Date: Thu Jan 26 07:53:00 2012 +0100
Round rendering of image to whole pixels (Bug #8317)
src/image_viewer.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/image_viewer.c b/src/image_viewer.c
index 3be326b..36a0f25 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -1002,8 +1002,8 @@ paint_image (
}
cairo_save (ctx);
- x_offset = viewer->priv->rendering.x_offset;
- y_offset = viewer->priv->rendering.y_offset;
+ x_offset = floor ( viewer->priv->rendering.x_offset );
+ y_offset = floor ( viewer->priv->rendering.y_offset );
/* BEGIN PAINT CHECKERED BACKGROUND */
if (TRUE == gdk_pixbuf_get_has_alpha (viewer->priv->pixbuf))
@@ -1063,8 +1063,8 @@ paint_image (
M_PI*0.5);
cairo_translate (
ctx,
- 0.0 - gtk_adjustment_get_value (viewer->vadjustment),
- gtk_adjustment_get_value (viewer->hadjustment));
+ 0.0 - floor (gtk_adjustment_get_value (viewer->vadjustment)),
+ floor (gtk_adjustment_get_value (viewer->hadjustment)));
cairo_translate (
ctx,
0.0,
@@ -1080,8 +1080,8 @@ paint_image (
M_PI*1.5);
cairo_translate (
ctx,
- gtk_adjustment_get_value (viewer->vadjustment),
- 0.0 - gtk_adjustment_get_value (viewer->hadjustment));
+ floor(gtk_adjustment_get_value (viewer->vadjustment)),
+ 0.0 - floor(gtk_adjustment_get_value (viewer->hadjustment)));
cairo_translate (
ctx,
-1.0 * viewer->priv->image_width * viewer->priv->scale,
@@ -1098,8 +1098,8 @@ paint_image (
M_PI);
cairo_translate (
ctx,
- gtk_adjustment_get_value (viewer->hadjustment),
- gtk_adjustment_get_value (viewer->vadjustment));
+ floor(gtk_adjustment_get_value (viewer->hadjustment)),
+ floor(gtk_adjustment_get_value (viewer->vadjustment)));
cairo_translate (
ctx,
-1.0 * viewer->priv->image_width * viewer->priv->scale,
@@ -1114,8 +1114,8 @@ paint_image (
default:
cairo_translate (
ctx,
- 0.0 - gtk_adjustment_get_value (viewer->hadjustment),
- 0.0 - gtk_adjustment_get_value (viewer->vadjustment));
+ 0.0 - floor(gtk_adjustment_get_value (viewer->hadjustment)),
+ 0.0 - floor(gtk_adjustment_get_value (viewer->vadjustment)));
cairo_translate (
ctx,
More information about the Xfce4-commits
mailing list