summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-20 19:56:34 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-20 19:56:34 (GMT)
commit29b390b5ed9f5c1a89db6d1e8d93d7126051b9a7 (patch)
tree685a1f321a2cc3c6ec55bcfbad2369199abe7576
parent27240161f95283b76260c570a95e11bbd2ed799d (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
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/panels/glance.c8
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 <nocbos@gmail.com>
+ * src/gui/panels/glance.c:
+ Avoid flickering when playing on the borders of the glance panel.
+
+12-11-20 Cyrille Bagard <nocbos@gmail.com>
+
* 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);
}