comparison Framework/Widgets/PanMouseTracker.cpp @ 457:3b4df9925db6 am-touch-events

added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
author Alain Mazy <alain@mazy.be>
date Thu, 24 Jan 2019 16:42:27 +0100
parents b70e9be013e4
children 4f2416d519b4
comparison
equal deleted inserted replaced
456:b70fcc134ba4 457:3b4df9925db6
44 44
45 45
46 void PanMouseTracker::MouseMove(int displayX, 46 void PanMouseTracker::MouseMove(int displayX,
47 int displayY, 47 int displayY,
48 double x, 48 double x,
49 double y) 49 double y,
50 const std::vector<Touch>& displayTouches,
51 const std::vector<Touch>& sceneTouches)
50 { 52 {
51 ViewportGeometry view = that_.GetView(); 53 ViewportGeometry view = that_.GetView();
52 view.SetPan(originalPanX_ + (x - downX_) * view.GetZoom(), 54 view.SetPan(originalPanX_ + (x - downX_) * view.GetZoom(),
53 originalPanY_ + (y - downY_) * view.GetZoom()); 55 originalPanY_ + (y - downY_) * view.GetZoom());
54 that_.SetView(view); 56 that_.SetView(view);