comparison Framework/Toolbox/ViewportGeometry.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 9a474e90e832
comparison
equal deleted inserted replaced
456:b70fcc134ba4 457:3b4df9925db6
119 displayX = static_cast<int>(boost::math::iround(x)); 119 displayX = static_cast<int>(boost::math::iround(x));
120 displayY = static_cast<int>(boost::math::iround(y)); 120 displayY = static_cast<int>(boost::math::iround(y));
121 } 121 }
122 122
123 123
124 void ViewportGeometry::MapPixelCenterToScene(std::vector<Touch>& sceneTouches /* out */,
125 const std::vector<Touch>& displayTouches) const
126 {
127 double sceneX, sceneY;
128 sceneTouches.clear();
129 for (size_t t = 0; t < displayTouches.size(); t++)
130 {
131 MapPixelCenterToScene(sceneX, sceneY, displayTouches[t].x, displayTouches[t].y);
132 sceneTouches.push_back(Touch((float)sceneX, (float)sceneY));
133 }
134 }
135
124 void ViewportGeometry::MapPixelCenterToScene(double& sceneX, 136 void ViewportGeometry::MapPixelCenterToScene(double& sceneX,
125 double& sceneY, 137 double& sceneY,
126 int x, 138 int x,
127 int y) const 139 int y) const
128 { 140 {