summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-05-02 13:43:06 -0400
committerraveit65 <[email protected]>2018-05-07 16:15:27 +0200
commit530d7cb6c43d5c0ae1659a1595e03136dbeedcc8 (patch)
treebdafee885acfb5a373bca1474884b3d1cd74eddd /src
parent5da033eb08220074dde938166c0228a70553b35c (diff)
downloadeom-530d7cb6c43d5c0ae1659a1595e03136dbeedcc8.tar.bz2
eom-530d7cb6c43d5c0ae1659a1595e03136dbeedcc8.tar.xz
svg: Fix offset coordinates when transforming SVG images on HiDPI displays
Diffstat (limited to 'src')
-rw-r--r--src/eom-scroll-view.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index f1cd1e8..2e9b7c5 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -1273,17 +1273,17 @@ display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
switch (eom_transform_get_transform_type (transform)) {
case EOM_TRANSFORM_ROT_90:
case EOM_TRANSFORM_FLIP_HORIZONTAL:
- image_offset_x = (double) gdk_pixbuf_get_width (priv->pixbuf) / priv->scale;
+ image_offset_x = (double) gdk_pixbuf_get_width (priv->pixbuf);
break;
case EOM_TRANSFORM_ROT_270:
case EOM_TRANSFORM_FLIP_VERTICAL:
- image_offset_y = (double) gdk_pixbuf_get_height (priv->pixbuf) / priv->scale;
+ image_offset_y = (double) gdk_pixbuf_get_height (priv->pixbuf);
break;
case EOM_TRANSFORM_ROT_180:
case EOM_TRANSFORM_TRANSPOSE:
case EOM_TRANSFORM_TRANSVERSE:
- image_offset_x = (double) gdk_pixbuf_get_width (priv->pixbuf) / priv->scale;
- image_offset_y = (double) gdk_pixbuf_get_height (priv->pixbuf) / priv->scale;
+ image_offset_x = (double) gdk_pixbuf_get_width (priv->pixbuf);
+ image_offset_y = (double) gdk_pixbuf_get_height (priv->pixbuf);
break;
case EOM_TRANSFORM_NONE:
default:
@@ -1292,7 +1292,8 @@ display_draw (GtkWidget *widget, cairo_t *cr, gpointer data)
cairo_matrix_init_translate (&translate, image_offset_x, image_offset_y);
cairo_matrix_multiply (&matrix, &matrix, &translate);
}
- cairo_matrix_init_scale (&scale, priv->zoom, priv->zoom);
+ /* Zoom factor for SVGs is already scaled, so scale back to application pixels. */
+ cairo_matrix_init_scale (&scale, priv->zoom / priv->scale, priv->zoom / priv->scale);
cairo_matrix_multiply (&matrix, &matrix, &scale);
cairo_matrix_init_translate (&translate, xofs, yofs);
cairo_matrix_multiply (&matrix, &matrix, &translate);