[eog/gnome-2-32] Make sure EogScrollView's adjustment values are always correctly set
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/gnome-2-32] Make sure EogScrollView's adjustment values are always correctly set
- Date: Sat, 9 Oct 2010 19:05:28 +0000 (UTC)
commit ab323d11c8a897993b47f96de2ac78cc715007ee
Author: Felix Riemann <friemann gnome org>
Date: Sat Oct 9 15:33:37 2010 +0200
Make sure EogScrollView's adjustment values are always correctly set
Ensures one can only scroll as far as necessary. If one scrolled to far
the images's last line/column was used for padding. Fixes bug 631710.
src/eog-scroll-view.c | 58 ++++++++++++++++++++----------------------------
1 files changed, 24 insertions(+), 34 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 84f6210..a1e6e85 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -267,9 +267,8 @@ update_scrollbar_values (EogScrollView *view)
{
EogScrollViewPrivate *priv;
int scaled_width, scaled_height;
- int xofs, yofs;
gdouble page_size,page_increment,step_increment;
- gdouble lower, upper, value;
+ gdouble lower, upper;
GtkAllocation allocation;
priv = view->priv;
@@ -290,23 +289,19 @@ update_scrollbar_values (EogScrollView *view)
/* Set scroll bounds and new offsets */
lower = 0;
upper = scaled_width;
- xofs = CLAMP (priv->xofs, 0, upper - page_size);
- if (gtk_adjustment_get_value (priv->hadj) != xofs) {
- value = xofs;
- priv->xofs = xofs;
-
- g_signal_handlers_block_matched (
- priv->hadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
-
- gtk_adjustment_configure (priv->hadj, value, lower,
- upper, step_increment,
- page_increment, page_size);
-
- g_signal_handlers_unblock_matched (
- priv->hadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
- }
+ priv->xofs = CLAMP (priv->xofs, 0, upper - page_size);
+
+ g_signal_handlers_block_matched (
+ priv->hadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
+
+ gtk_adjustment_configure (priv->hadj, priv->xofs, lower,
+ upper, step_increment,
+ page_increment, page_size);
+
+ g_signal_handlers_unblock_matched (
+ priv->hadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
}
if (gtk_widget_get_visible (GTK_WIDGET (priv->vbar))) {
@@ -316,24 +311,19 @@ update_scrollbar_values (EogScrollView *view)
lower = 0;
upper = scaled_height;
- yofs = CLAMP (priv->yofs, 0, upper - page_size);
-
- if (gtk_adjustment_get_value (priv->vadj) != yofs) {
- value = yofs;
- priv->yofs = yofs;
+ priv->yofs = CLAMP (priv->yofs, 0, upper - page_size);
- g_signal_handlers_block_matched (
- priv->vadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
+ g_signal_handlers_block_matched (
+ priv->vadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
- gtk_adjustment_configure (priv->vadj, value, lower,
- upper, step_increment,
- page_increment, page_size);
+ gtk_adjustment_configure (priv->vadj, priv->yofs, lower,
+ upper, step_increment,
+ page_increment, page_size);
- g_signal_handlers_unblock_matched (
- priv->vadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
- }
+ g_signal_handlers_unblock_matched (
+ priv->vadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]