[gtk+] zoom scrolling: Improve the previous fix
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] zoom scrolling: Improve the previous fix
- Date: Mon, 23 Feb 2015 12:30:35 +0000 (UTC)
commit c060d93e3dc8abea39b919ac61434219b4318f25
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 23 07:28:40 2015 -0500
zoom scrolling: Improve the previous fix
As Sebastian pointed out, just resetting the initial slider
position was an incomplete fix, because it does not cause the
delta to be recomputed, which is important in this scenario,
because you've likely travelled some distance over the slider
before the long press kicks in.
Instead, explicitly record both the slider position and the
delta.
gtk/gtkrange.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index bd95ee9..277b78d 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2437,10 +2437,21 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
gdouble y,
GtkRange *range)
{
- if (!range->priv->zoom)
+ GtkRangePrivate *priv = range->priv;
+
+ if (!priv->zoom)
{
- /* unset initial position so it can be calculated */
- range->priv->slide_initial_slider_position = -1;
+ if (priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ priv->slide_initial_slider_position = priv->slider.y;
+ priv->slide_initial_coordinate_delta = y - priv->slider.y;
+ }
+ else
+ {
+ priv->slide_initial_slider_position = priv->slider.x;
+ priv->slide_initial_coordinate_delta = x - priv->slider.x;
+ }
+
update_zoom_state (range, TRUE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]