diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-20 19:56:34 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-20 19:56:34 (GMT) |
commit | 29b390b5ed9f5c1a89db6d1e8d93d7126051b9a7 (patch) | |
tree | 685a1f321a2cc3c6ec55bcfbad2369199abe7576 /src/gui | |
parent | 27240161f95283b76260c570a95e11bbd2ed799d (diff) |
Avoided flickering when playing on the borders of the glance panel.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@287 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/panels/glance.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c index fb1723a..abbe6a1 100644 --- a/src/gui/panels/glance.c +++ b/src/gui/panels/glance.c @@ -626,6 +626,7 @@ static gboolean on_mouse_motion_over_glance(GtkWidget *widget, GdkEventMotion *e gdouble diff_y; /* Evolution sur les ordonnées */ GtkAdjustment *hadj; /* Gestionnaire du défilement */ GtkAdjustment *vadj; /* Gestionnaire du défilement */ + gdouble value; /* Nouvelle valeur bornée */ if (panel->view != NULL && event->state & GDK_BUTTON1_MASK && panel->valid) { @@ -635,8 +636,11 @@ static gboolean on_mouse_motion_over_glance(GtkWidget *widget, GdkEventMotion *e hadj = gtk_scrolled_window_get_hadjustment(panel->support); vadj = gtk_scrolled_window_get_vadjustment(panel->support); - gtk_adjustment_set_value(hadj, panel->ref_h + diff_x); - gtk_adjustment_set_value(vadj, panel->ref_v + diff_y); + value = CLAMP(panel->ref_h + diff_x, hadj->lower, hadj->upper - hadj->page_size); + gtk_adjustment_set_value(hadj, value); + + value = CLAMP(panel->ref_v + diff_y, vadj->lower, vadj->upper - vadj->page_size); + gtk_adjustment_set_value(vadj, value); } |