| 1242 | } |
| 1243 | |
| 1244 | QRect PageViewAnnotator::routeTabletEvent(QTabletEvent *e, PageViewItem *item, const QPoint localOriginInGlobal) |
| 1245 | { |
| 1246 | // Unlike routeMouseEvent, routeTabletEvent must explicitly ignore events it doesn't care about so that |
| 1247 | // the corresponding mouse event will later be delivered. |
| 1248 | if (!item) { |
| 1249 | e->ignore(); |
| 1250 | return QRect(); |
| 1251 | } |
| 1252 | |
| 1253 | AnnotatorEngine::EventType eventType; |
| 1254 | AnnotatorEngine::Button button; |
| 1255 | AnnotatorEngine::Modifiers modifiers; |
| 1256 | |
| 1257 | // figure out the event type and button |
| 1258 | AnnotatorEngine::decodeEvent(e, &eventType, &button); |
| 1259 | |
| 1260 | // Constrain angle if action checked XOR shift button pressed. |
| 1261 | modifiers.constrainRatioAndAngle = (bool(constrainRatioAndAngleActive()) != bool(e->modifiers() & Qt::ShiftModifier)); |
| 1262 | |
| 1263 | const QPointF globalPosF = e->globalPosition(); |
| 1264 | const QPointF localPosF = globalPosF - localOriginInGlobal; |
| 1265 | return performRouteMouseOrTabletEvent(eventType, button, modifiers, localPosF, item); |
| 1266 | } |
| 1267 | |
| 1268 | bool PageViewAnnotator::routeKeyEvent(QKeyEvent *event) |
| 1269 | { |