| 191 | return getRect(mouseEvent.projection()).contains(mouseEvent.innerPoint()); |
| 192 | } |
| 193 | bool mouseEvent(const MouseEvent &mouseEvent) { |
| 194 | if (mouseEvent.event() == cv::MouseEventTypes::EVENT_LBUTTONDOWN |
| 195 | && hitTest(mouseEvent)){ |
| 196 | _dragging = true; |
| 197 | _dragOffset = mouseEvent.pos() - _point; |
| 198 | return true; |
| 199 | } |
| 200 | if (_dragging && mouseEvent.event() == cv::MouseEventTypes::EVENT_MOUSEMOVE) { |
| 201 | _point = cv::Vec2d(mouseEvent.pos()) - _dragOffset; |
| 202 | return true; |
| 203 | } |
| 204 | if (_dragging && mouseEvent.event() == cv::MouseEventTypes::EVENT_LBUTTONUP) { |
| 205 | _dragging = false; |
| 206 | return true; |
| 207 | } |
| 208 | return false; |
| 209 | }; |
| 210 | }; |
| 211 | Axes axes = makePlotAxes(); |
| 212 | axes.setXLim({ 0,2 }); |
no test coverage detected