[gthumb] fixed keeping the center of the image after changing zoom
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] fixed keeping the center of the image after changing zoom
- Date: Sat, 9 Nov 2013 20:02:33 +0000 (UTC)
commit f3771363c015282fb32a69dace759f8a4e716731
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Oct 11 18:54:12 2013 +0200
fixed keeping the center of the image after changing zoom
gthumb/gth-image-viewer.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index a620e7f..040b830 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -350,6 +350,8 @@ set_zoom (GthImageViewer *self,
/* try to keep the center of the view visible. */
_gth_image_viewer_get_visible_area_size (self, &visible_width, &visible_height);
zoom_ratio = zoom_level / self->priv->zoom_level;
+ center_x = center_x - self->image_area.x;
+ center_y = center_y - self->image_area.y;
self->x_offset = ((self->x_offset + center_x) * zoom_ratio - visible_width / 2);
self->y_offset = ((self->y_offset + center_y) * zoom_ratio - visible_height / 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]