| ... |
... |
@@ -402,6 +402,10 @@ public: |
|
402
|
402
|
wxPoint m_lastTouchPoint;
|
|
403
|
403
|
GdkEventSequence* m_touchSequence;
|
|
404
|
404
|
bool m_rawTouchEvents;
|
|
|
405
|
+ double m_lastPanOffset; // Last offset for the pan gesture, used to calculate deltas for pan gesture event
|
|
|
406
|
+ gdouble m_lastScale; // Last scale provided by GTK, used when zoom gesture ends
|
|
|
407
|
+ gdouble m_lastAngleDelta; // Last angle provided by GTK, used when rotate gesture ends
|
|
|
408
|
+ wxPoint m_lastGesturePoint; // Last zoom/rotate gesture point
|
|
405
|
409
|
|
|
406
|
410
|
GtkGesture* m_vertical_pan_gesture;
|
|
407
|
411
|
GtkGesture* m_horizontal_pan_gesture;
|
| ... |
... |
@@ -418,21 +422,6 @@ typedef wxExternalField<wxWindow, |
|
418
|
422
|
|
|
419
|
423
|
} // anonymous namespace
|
|
420
|
424
|
|
|
421
|
|
-// This is true when the gesture has just started (currently used for pan gesture only)
|
|
422
|
|
-static bool gs_gestureStart = false;
|
|
423
|
|
-
|
|
424
|
|
-// Last offset for the pan gesture, this is used to calculate deltas for pan gesture event
|
|
425
|
|
-static double gs_lastOffset = 0;
|
|
426
|
|
-
|
|
427
|
|
-// Last scale provided by GTK
|
|
428
|
|
-static gdouble gs_lastScale = 1.0;
|
|
429
|
|
-
|
|
430
|
|
-// This is used to set the angle when rotate gesture ends.
|
|
431
|
|
-static gdouble gs_lastAngle = 0;
|
|
432
|
|
-
|
|
433
|
|
-// Last Zoom/Rotate gesture point
|
|
434
|
|
-static wxPoint gs_lastGesturePoint;
|
|
435
|
|
-
|
|
436
|
425
|
#endif // wxGTK_HAS_GESTURES_SUPPORT
|
|
437
|
426
|
|
|
438
|
427
|
//-----------------------------------------------------------------------------
|
| ... |
... |
@@ -3351,25 +3340,16 @@ enum GestureStates |
|
3351
|
3340
|
end
|
|
3352
|
3341
|
};
|
|
3353
|
3342
|
|
|
3354
|
|
-enum TrackedGestures
|
|
|
3343
|
+enum TrackedGesture
|
|
3355
|
3344
|
{
|
|
3356
|
3345
|
two_finger_tap = 0x0001,
|
|
3357
|
3346
|
press_and_tap = 0x0002,
|
|
3358
|
3347
|
horizontal_pan = 0x0004,
|
|
3359
|
|
- vertical_pan = 0x0008
|
|
|
3348
|
+ vertical_pan = 0x0008,
|
|
|
3349
|
+ rotate = 0x0010,
|
|
|
3350
|
+ zoom = 0x0020,
|
|
3360
|
3351
|
};
|
|
3361
|
3352
|
|
|
3362
|
|
-extern "C" {
|
|
3363
|
|
-static void
|
|
3364
|
|
-pan_gesture_begin_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* WXUNUSED(win))
|
|
3365
|
|
-{
|
|
3366
|
|
- gs_gestureStart = true;
|
|
3367
|
|
-
|
|
3368
|
|
- // Set it to 0, as this will be used to calculate the deltas for new pan gesture
|
|
3369
|
|
- gs_lastOffset = 0;
|
|
3370
|
|
-}
|
|
3371
|
|
-}
|
|
3372
|
|
-
|
|
3373
|
3353
|
extern "C" {
|
|
3374
|
3354
|
static void
|
|
3375
|
3355
|
horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequence, wxWindow* win)
|
| ... |
... |
@@ -3378,8 +3358,8 @@ horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* seque |
|
3378
|
3358
|
if ( !data )
|
|
3379
|
3359
|
return;
|
|
3380
|
3360
|
|
|
3381
|
|
- // Do not process horizontal pan, if there was no "pan" signal for it.
|
|
3382
|
|
- if ( !(data->m_allowedGestures & horizontal_pan) )
|
|
|
3361
|
+ // Ignore the signal if the gesture isn't active
|
|
|
3362
|
+ if ( !(data->m_activeGestures & horizontal_pan) )
|
|
3383
|
3363
|
{
|
|
3384
|
3364
|
return;
|
|
3385
|
3365
|
}
|
| ... |
... |
@@ -3391,14 +3371,14 @@ horizontal_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* seque |
|
3391
|
3371
|
return;
|
|
3392
|
3372
|
}
|
|
3393
|
3373
|
|
|
3394
|
|
- data->m_allowedGestures &= ~horizontal_pan;
|
|
3395
|
|
-
|
|
3396
|
3374
|
wxPanGestureEvent event(win->GetId());
|
|
3397
|
3375
|
|
|
3398
|
3376
|
event.SetEventObject(win);
|
|
3399
|
3377
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3400
|
3378
|
event.SetGestureEnd();
|
|
3401
|
3379
|
|
|
|
3380
|
+ data->m_activeGestures &= ~horizontal_pan;
|
|
|
3381
|
+
|
|
3402
|
3382
|
win->GTKProcessEvent(event);
|
|
3403
|
3383
|
}
|
|
3404
|
3384
|
}
|
| ... |
... |
@@ -3411,8 +3391,8 @@ vertical_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequenc |
|
3411
|
3391
|
if ( !data )
|
|
3412
|
3392
|
return;
|
|
3413
|
3393
|
|
|
3414
|
|
- // Do not process vertical pan, if there was no "pan" signal for it.
|
|
3415
|
|
- if ( !(data->m_allowedGestures & vertical_pan) )
|
|
|
3394
|
+ // Ignore the signal if the gesture isn't active
|
|
|
3395
|
+ if ( !(data->m_activeGestures & vertical_pan) )
|
|
3416
|
3396
|
{
|
|
3417
|
3397
|
return;
|
|
3418
|
3398
|
}
|
| ... |
... |
@@ -3424,14 +3404,14 @@ vertical_pan_gesture_end_callback(GtkGesture* gesture, GdkEventSequence* sequenc |
|
3424
|
3404
|
return;
|
|
3425
|
3405
|
}
|
|
3426
|
3406
|
|
|
3427
|
|
- data->m_allowedGestures &= ~vertical_pan;
|
|
3428
|
|
-
|
|
3429
|
3407
|
wxPanGestureEvent event(win->GetId());
|
|
3430
|
3408
|
|
|
3431
|
3409
|
event.SetEventObject(win);
|
|
3432
|
3410
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3433
|
3411
|
event.SetGestureEnd();
|
|
3434
|
3412
|
|
|
|
3413
|
+ data->m_activeGestures &= ~vertical_pan;
|
|
|
3414
|
+
|
|
3435
|
3415
|
win->GTKProcessEvent(event);
|
|
3436
|
3416
|
}
|
|
3437
|
3417
|
}
|
| ... |
... |
@@ -3440,6 +3420,10 @@ extern "C" { |
|
3440
|
3420
|
static void
|
|
3441
|
3421
|
pan_gesture_callback(GtkGesture* gesture, GtkPanDirection direction, gdouble offset, wxWindow* win)
|
|
3442
|
3422
|
{
|
|
|
3423
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3424
|
+ if ( !data )
|
|
|
3425
|
+ return;
|
|
|
3426
|
+
|
|
3443
|
3427
|
// The function that retrieves the GdkEventSequence (which will further be used to get the gesture point)
|
|
3444
|
3428
|
// should be called only when the gestrure is active
|
|
3445
|
3429
|
if ( !gtk_gesture_is_active(gesture) )
|
| ... |
... |
@@ -3461,44 +3445,47 @@ pan_gesture_callback(GtkGesture* gesture, GtkPanDirection direction, gdouble off |
|
3461
|
3445
|
event.SetEventObject(win);
|
|
3462
|
3446
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3463
|
3447
|
|
|
3464
|
|
- wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
3465
|
|
- if ( !data )
|
|
|
3448
|
+ TrackedGesture gesture_type = direction == GTK_PAN_DIRECTION_UP || direction == GTK_PAN_DIRECTION_DOWN
|
|
|
3449
|
+ ? vertical_pan : horizontal_pan;
|
|
|
3450
|
+
|
|
|
3451
|
+ if ( !(data->m_activeGestures & (horizontal_pan | vertical_pan)) )
|
|
|
3452
|
+ {
|
|
|
3453
|
+ // For the pan gesture, unlike the others, we only consider the gesture started once we actually receive a pan signal
|
|
|
3454
|
+ data->m_activeGestures |= gesture_type;
|
|
|
3455
|
+ data->m_lastPanOffset = 0;
|
|
|
3456
|
+ event.SetGestureStart();
|
|
|
3457
|
+ }
|
|
|
3458
|
+ else if ( !(data->m_activeGestures & gesture_type) )
|
|
|
3459
|
+ {
|
|
|
3460
|
+ // We shouldn't receive horizontal pan events while a vertical pan is active and vice versa,
|
|
|
3461
|
+ // but let's ignore the event just in case
|
|
3466
|
3462
|
return;
|
|
|
3463
|
+ }
|
|
3467
|
3464
|
|
|
3468
|
3465
|
// This is the difference between this and the last pan gesture event in the current sequence
|
|
3469
|
|
- int delta = wxRound(offset - gs_lastOffset);
|
|
|
3466
|
+ int delta = wxRound(offset - data->m_lastPanOffset);
|
|
3470
|
3467
|
|
|
3471
|
3468
|
switch ( direction )
|
|
3472
|
3469
|
{
|
|
3473
|
3470
|
case GTK_PAN_DIRECTION_UP:
|
|
3474
|
|
- data->m_allowedGestures |= vertical_pan;
|
|
3475
|
3471
|
event.SetDelta(wxPoint(0, -delta));
|
|
3476
|
3472
|
break;
|
|
3477
|
3473
|
|
|
3478
|
3474
|
case GTK_PAN_DIRECTION_DOWN:
|
|
3479
|
|
- data->m_allowedGestures |= vertical_pan;
|
|
3480
|
3475
|
event.SetDelta(wxPoint(0, delta));
|
|
3481
|
3476
|
break;
|
|
3482
|
3477
|
|
|
3483
|
3478
|
case GTK_PAN_DIRECTION_RIGHT:
|
|
3484
|
|
- data->m_allowedGestures |= horizontal_pan;
|
|
3485
|
3479
|
event.SetDelta(wxPoint(delta, 0));
|
|
3486
|
3480
|
break;
|
|
3487
|
3481
|
|
|
3488
|
3482
|
case GTK_PAN_DIRECTION_LEFT:
|
|
3489
|
|
- data->m_allowedGestures |= horizontal_pan;
|
|
3490
|
3483
|
event.SetDelta(wxPoint(-delta, 0));
|
|
3491
|
3484
|
break;
|
|
3492
|
3485
|
}
|
|
3493
|
3486
|
|
|
3494
|
|
- // Update gs_lastOffset
|
|
3495
|
|
- gs_lastOffset = offset;
|
|
3496
|
|
-
|
|
3497
|
|
- if ( gs_gestureStart )
|
|
3498
|
|
- {
|
|
3499
|
|
- event.SetGestureStart();
|
|
3500
|
|
- gs_gestureStart = false;
|
|
3501
|
|
- }
|
|
|
3487
|
+ // Update m_lastPanOffset
|
|
|
3488
|
+ data->m_lastPanOffset = offset;
|
|
3502
|
3489
|
|
|
3503
|
3490
|
// Cancel press and tap gesture if it is not active during "pan" signal.
|
|
3504
|
3491
|
if( !(data->m_activeGestures & press_and_tap) )
|
| ... |
... |
@@ -3514,6 +3501,10 @@ extern "C" { |
|
3514
|
3501
|
static void
|
|
3515
|
3502
|
zoom_gesture_callback(GtkGesture* gesture, gdouble scale, wxWindow* win)
|
|
3516
|
3503
|
{
|
|
|
3504
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3505
|
+ if ( !data )
|
|
|
3506
|
+ return;
|
|
|
3507
|
+
|
|
3517
|
3508
|
gdouble x, y;
|
|
3518
|
3509
|
|
|
3519
|
3510
|
if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
|
| ... |
... |
@@ -3527,21 +3518,17 @@ zoom_gesture_callback(GtkGesture* gesture, gdouble scale, wxWindow* win) |
|
3527
|
3518
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3528
|
3519
|
event.SetZoomFactor(scale);
|
|
3529
|
3520
|
|
|
3530
|
|
- wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
3531
|
|
- if ( !data )
|
|
3532
|
|
- return;
|
|
3533
|
|
-
|
|
3534
|
|
- // Cancel "Two FInger Tap Event" if scale has changed
|
|
3535
|
|
- if ( wxRound(scale * 1000) != wxRound(gs_lastScale * 1000) )
|
|
|
3521
|
+ // Cancel "Two Finger Tap Event" if scale has changed
|
|
|
3522
|
+ if ( wxRound(scale * 1000) != wxRound(data->m_lastScale * 1000) )
|
|
3536
|
3523
|
{
|
|
3537
|
3524
|
data->m_allowedGestures &= ~two_finger_tap;
|
|
3538
|
3525
|
}
|
|
3539
|
3526
|
|
|
3540
|
|
- gs_lastScale = scale;
|
|
|
3527
|
+ data->m_lastScale = scale;
|
|
3541
|
3528
|
|
|
3542
|
3529
|
// Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
|
|
3543
|
3530
|
// in the "end" signal is not a zoom center
|
|
3544
|
|
- gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
|
3531
|
+ data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
3545
|
3532
|
|
|
3546
|
3533
|
win->GTKProcessEvent(event);
|
|
3547
|
3534
|
}
|
| ... |
... |
@@ -3551,6 +3538,10 @@ extern "C" { |
|
3551
|
3538
|
static void
|
|
3552
|
3539
|
zoom_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
|
|
3553
|
3540
|
{
|
|
|
3541
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3542
|
+ if ( !data )
|
|
|
3543
|
+ return;
|
|
|
3544
|
+
|
|
3554
|
3545
|
gdouble x, y;
|
|
3555
|
3546
|
|
|
3556
|
3547
|
if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
|
| ... |
... |
@@ -3558,17 +3549,19 @@ zoom_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequ |
|
3558
|
3549
|
return;
|
|
3559
|
3550
|
}
|
|
3560
|
3551
|
|
|
3561
|
|
- gs_lastScale = 1.0;
|
|
3562
|
|
-
|
|
3563
|
3552
|
wxZoomGestureEvent event(win->GetId());
|
|
3564
|
3553
|
|
|
3565
|
3554
|
event.SetEventObject(win);
|
|
3566
|
3555
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3567
|
3556
|
event.SetGestureStart();
|
|
3568
|
3557
|
|
|
|
3558
|
+ data->m_activeGestures |= zoom;
|
|
|
3559
|
+
|
|
|
3560
|
+ data->m_lastScale = 1;
|
|
|
3561
|
+
|
|
3569
|
3562
|
// Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
|
|
3570
|
3563
|
// in the "end" signal is not a zoom center
|
|
3571
|
|
- gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
|
3564
|
+ data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
3572
|
3565
|
|
|
3573
|
3566
|
win->GTKProcessEvent(event);
|
|
3574
|
3567
|
}
|
| ... |
... |
@@ -3578,12 +3571,24 @@ extern "C" { |
|
3578
|
3571
|
static void
|
|
3579
|
3572
|
zoom_gesture_end_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
|
|
3580
|
3573
|
{
|
|
|
3574
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3575
|
+ if ( !data )
|
|
|
3576
|
+ return;
|
|
|
3577
|
+
|
|
|
3578
|
+ // Ignore the signal if the gesture isn't active
|
|
|
3579
|
+ if ( !(data->m_activeGestures & zoom) )
|
|
|
3580
|
+ {
|
|
|
3581
|
+ return;
|
|
|
3582
|
+ }
|
|
|
3583
|
+
|
|
3581
|
3584
|
wxZoomGestureEvent event(win->GetId());
|
|
3582
|
3585
|
|
|
3583
|
3586
|
event.SetEventObject(win);
|
|
3584
|
|
- event.SetPosition(gs_lastGesturePoint);
|
|
|
3587
|
+ event.SetPosition(data->m_lastGesturePoint);
|
|
3585
|
3588
|
event.SetGestureEnd();
|
|
3586
|
|
- event.SetZoomFactor(gs_lastScale);
|
|
|
3589
|
+ event.SetZoomFactor(data->m_lastScale);
|
|
|
3590
|
+
|
|
|
3591
|
+ data->m_activeGestures &= ~zoom;
|
|
3587
|
3592
|
|
|
3588
|
3593
|
win->GTKProcessEvent(event);
|
|
3589
|
3594
|
}
|
| ... |
... |
@@ -3593,6 +3598,10 @@ extern "C" { |
|
3593
|
3598
|
static void
|
|
3594
|
3599
|
rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
|
|
3595
|
3600
|
{
|
|
|
3601
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3602
|
+ if ( !data )
|
|
|
3603
|
+ return;
|
|
|
3604
|
+
|
|
3596
|
3605
|
gdouble x, y;
|
|
3597
|
3606
|
|
|
3598
|
3607
|
if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
|
| ... |
... |
@@ -3606,9 +3615,13 @@ rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(se |
|
3606
|
3615
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3607
|
3616
|
event.SetGestureStart();
|
|
3608
|
3617
|
|
|
|
3618
|
+ data->m_activeGestures |= rotate;
|
|
|
3619
|
+
|
|
|
3620
|
+ data->m_lastAngleDelta = 0;
|
|
|
3621
|
+
|
|
3609
|
3622
|
// Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
|
|
3610
|
3623
|
// in the "end" signal is not a rotation center
|
|
3611
|
|
- gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
|
3624
|
+ data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
3612
|
3625
|
|
|
3613
|
3626
|
win->GTKProcessEvent(event);
|
|
3614
|
3627
|
}
|
| ... |
... |
@@ -3616,8 +3629,12 @@ rotate_gesture_begin_callback(GtkGesture* gesture, GdkEventSequence* WXUNUSED(se |
|
3616
|
3629
|
|
|
3617
|
3630
|
extern "C" {
|
|
3618
|
3631
|
static void
|
|
3619
|
|
-rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle_delta), gdouble angle, wxWindowGTK* win)
|
|
|
3632
|
+rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle), gdouble angle_delta, wxWindowGTK* win)
|
|
3620
|
3633
|
{
|
|
|
3634
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3635
|
+ if ( !data )
|
|
|
3636
|
+ return;
|
|
|
3637
|
+
|
|
3621
|
3638
|
gdouble x, y;
|
|
3622
|
3639
|
|
|
3623
|
3640
|
if ( !gtk_gesture_get_bounding_box_center(gesture, &x, &y) )
|
| ... |
... |
@@ -3629,15 +3646,15 @@ rotate_gesture_callback(GtkGesture* gesture, gdouble WXUNUSED(angle_delta), gdou |
|
3629
|
3646
|
|
|
3630
|
3647
|
event.SetEventObject(win);
|
|
3631
|
3648
|
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
|
|
3632
|
|
-
|
|
3633
|
|
- event.SetRotationAngle(angle);
|
|
|
3649
|
+ // angle is the absolute orientation of the two fingers, angle_delta is the angle relative to when the gesure started
|
|
|
3650
|
+ event.SetRotationAngle(angle_delta);
|
|
3634
|
3651
|
|
|
3635
|
3652
|
// Save the angle to set it when the gesture ends.
|
|
3636
|
|
- gs_lastAngle = angle;
|
|
|
3653
|
+ data->m_lastAngleDelta = angle_delta;
|
|
3637
|
3654
|
|
|
3638
|
3655
|
// Save this point because the point obtained through gtk_gesture_get_bounding_box_center()
|
|
3639
|
3656
|
// in the "end" signal is not a rotation center
|
|
3640
|
|
- gs_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
|
3657
|
+ data->m_lastGesturePoint = wxPoint(wxRound(x), wxRound(y));
|
|
3641
|
3658
|
|
|
3642
|
3659
|
win->GTKProcessEvent(event);
|
|
3643
|
3660
|
}
|
| ... |
... |
@@ -3647,12 +3664,24 @@ extern "C" { |
|
3647
|
3664
|
static void
|
|
3648
|
3665
|
rotate_gesture_end_callback(GtkGesture* WXUNUSED(gesture), GdkEventSequence* WXUNUSED(sequence), wxWindowGTK* win)
|
|
3649
|
3666
|
{
|
|
|
3667
|
+ wxWindowGesturesData* const data = wxWindowGestures::FromObject(win);
|
|
|
3668
|
+ if ( !data )
|
|
|
3669
|
+ return;
|
|
|
3670
|
+
|
|
|
3671
|
+ // Ignore the signal if the gesture isn't active
|
|
|
3672
|
+ if ( !(data->m_activeGestures & rotate) )
|
|
|
3673
|
+ {
|
|
|
3674
|
+ return;
|
|
|
3675
|
+ }
|
|
|
3676
|
+
|
|
3650
|
3677
|
wxRotateGestureEvent event(win->GetId());
|
|
3651
|
3678
|
|
|
3652
|
3679
|
event.SetEventObject(win);
|
|
3653
|
|
- event.SetPosition(gs_lastGesturePoint);
|
|
|
3680
|
+ event.SetPosition(data->m_lastGesturePoint);
|
|
3654
|
3681
|
event.SetGestureEnd();
|
|
3655
|
|
- event.SetRotationAngle(gs_lastAngle);
|
|
|
3682
|
+ event.SetRotationAngle(data->m_lastAngleDelta);
|
|
|
3683
|
+
|
|
|
3684
|
+ data->m_activeGestures &= ~rotate;
|
|
3656
|
3685
|
|
|
3657
|
3686
|
win->GTKProcessEvent(event);
|
|
3658
|
3687
|
}
|
| ... |
... |
@@ -3981,6 +4010,9 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win, |
|
3981
|
4010
|
m_activeGestures = 0;
|
|
3982
|
4011
|
m_touchSequence = nullptr;
|
|
3983
|
4012
|
m_rawTouchEvents = false;
|
|
|
4013
|
+ m_lastPanOffset = 0;
|
|
|
4014
|
+ m_lastScale = 1;
|
|
|
4015
|
+ m_lastAngleDelta = 0;
|
|
3984
|
4016
|
|
|
3985
|
4017
|
if ( eventsMask & wxTOUCH_VERTICAL_PAN_GESTURE )
|
|
3986
|
4018
|
{
|
| ... |
... |
@@ -3990,8 +4022,6 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win, |
|
3990
|
4022
|
|
|
3991
|
4023
|
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER(m_vertical_pan_gesture), GTK_PHASE_TARGET);
|
|
3992
|
4024
|
|
|
3993
|
|
- g_signal_connect (m_vertical_pan_gesture, "begin",
|
|
3994
|
|
- G_CALLBACK(pan_gesture_begin_callback), win);
|
|
3995
|
4025
|
g_signal_connect (m_vertical_pan_gesture, "pan",
|
|
3996
|
4026
|
G_CALLBACK(pan_gesture_callback), win);
|
|
3997
|
4027
|
g_signal_connect (m_vertical_pan_gesture, "end",
|
| ... |
... |
@@ -4017,8 +4047,6 @@ void wxWindowGesturesData::Reinit(wxWindowGTK* win, |
|
4017
|
4047
|
|
|
4018
|
4048
|
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER(m_horizontal_pan_gesture), GTK_PHASE_TARGET);
|
|
4019
|
4049
|
|
|
4020
|
|
- g_signal_connect (m_horizontal_pan_gesture, "begin",
|
|
4021
|
|
- G_CALLBACK(pan_gesture_begin_callback), win);
|
|
4022
|
4050
|
g_signal_connect (m_horizontal_pan_gesture, "pan",
|
|
4023
|
4051
|
G_CALLBACK(pan_gesture_callback), win);
|
|
4024
|
4052
|
g_signal_connect (m_horizontal_pan_gesture, "end",
|