From 29b390b5ed9f5c1a89db6d1e8d93d7126051b9a7 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 20 Nov 2012 19:56:34 +0000 Subject: 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 --- ChangeLog | 5 +++++ src/gui/panels/glance.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6dcedb6..f5e628d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 12-11-20 Cyrille Bagard + * src/gui/panels/glance.c: + Avoid flickering when playing on the borders of the glance panel. + +12-11-20 Cyrille Bagard + * plugins/androhelpers/try_n_catch.c: Fix some links to Dalvik exception handlers. 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); } -- cgit v0.11.2-87-g4458