[gthumb] "High" quality zoom is pixelated on hi-dpi monitors
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] "High" quality zoom is pixelated on hi-dpi monitors
- Date: Wed, 25 Oct 2017 17:05:45 +0000 (UTC)
commit e157afe353027b17bf6ce0a1ccdd02af09650d21
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Oct 25 19:02:56 2017 +0200
"High" quality zoom is pixelated on hi-dpi monitors
[bug #779340]
extensions/image_viewer/gth-image-viewer-page.c | 4 ++--
gthumb/gth-image-dragger.c | 11 +++++++----
2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 33b62ca..f081c20 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -170,7 +170,7 @@ _gth_image_preloader_get_requested_size_for_next_images (GthImageViewerPage *sel
break;
}
- return requested_size;
+ return requested_size * gtk_widget_get_scale_factor (GTK_WIDGET (self->priv->viewer));
}
@@ -201,7 +201,7 @@ _gth_image_preloader_get_requested_size_for_current_image (GthImageViewerPage *s
break;
}
- return requested_size;
+ return requested_size * gtk_widget_get_scale_factor (GTK_WIDGET (self->priv->viewer));
}
diff --git a/gthumb/gth-image-dragger.c b/gthumb/gth-image-dragger.c
index 546c766..aad7630 100644
--- a/gthumb/gth-image-dragger.c
+++ b/gthumb/gth-image-dragger.c
@@ -493,6 +493,7 @@ _gth_image_dragger_update_scaled_image (GthImageDragger *self)
int image_width, image_height;
int original_width, original_height;
int new_width, new_height;
+ int screen_scale_factor;
scale_filter_t filter;
self->priv->scaled_zoom = 0;
@@ -517,20 +518,22 @@ _gth_image_dragger_update_scaled_image (GthImageDragger *self)
return;
}
- if (gth_image_viewer_get_zoom_quality_filter (self->priv->viewer) == CAIRO_FILTER_FAST) {
+ screen_scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (self->priv->viewer));
+
+ if ((screen_scale_factor == 1) && (gth_image_viewer_get_zoom_quality_filter (self->priv->viewer) ==
CAIRO_FILTER_FAST)) {
gtk_widget_queue_draw (GTK_WIDGET (self->priv->viewer));
return;
}
zoom_from_original = gth_image_viewer_get_zoom (self->priv->viewer);
gth_image_viewer_get_original_size (self->priv->viewer, &original_width, &original_height);
- new_width = zoom_from_original * original_width;
- new_height = zoom_from_original * original_height;
+ new_width = zoom_from_original * original_width * screen_scale_factor;
+ new_height = zoom_from_original * original_height * screen_scale_factor;
image_width = cairo_image_surface_get_width (image);
image_height = cairo_image_surface_get_height (image);
zoom_from_image = (double) new_width / image_width;
- if (zoom_from_image >= 1.0) {
+ if ((screen_scale_factor == 1) && (zoom_from_image >= 1.0)) {
gtk_widget_queue_draw (GTK_WIDGET (self->priv->viewer));
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]