Commit 4589f0e0 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

rotate: Ensure delta is between [0..2π]

parent c34280d9
......@@ -110,15 +110,18 @@ static gboolean
_gtk_gesture_rotate_check_emit (GtkGestureRotate *gesture)
{
GtkGestureRotatePrivate *priv;
gdouble angle;
gdouble angle, delta;
if (!_gtk_gesture_rotate_get_angle (gesture, &angle))
return FALSE;
priv = gtk_gesture_rotate_get_instance_private (gesture);
delta = angle - priv->initial_angle;
if (delta < 0)
delta += 2 * G_PI;
g_signal_emit (gesture, signals[ANGLE_CHANGED], 0,
angle, angle - priv->initial_angle);
g_signal_emit (gesture, signals[ANGLE_CHANGED], 0, angle, delta);
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment