Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/abstractimageview.cpp
Show First 20 Lines • Show All 316 Lines • ▼ Show 20 Line(s) | |||||
317 | 317 | | |||
318 | void AbstractImageView::mousePressEvent(QGraphicsSceneMouseEvent* event) | 318 | void AbstractImageView::mousePressEvent(QGraphicsSceneMouseEvent* event) | ||
319 | { | 319 | { | ||
320 | QGraphicsItem::mousePressEvent(event); | 320 | QGraphicsItem::mousePressEvent(event); | ||
321 | if (event->button() == Qt::MiddleButton) { | 321 | if (event->button() == Qt::MiddleButton) { | ||
322 | bool value = !zoomToFit(); | 322 | bool value = !zoomToFit(); | ||
323 | setZoomToFit(value); | 323 | setZoomToFit(value); | ||
324 | if (!value) { | 324 | if (!value) { | ||
325 | setZoom(1.); | 325 | setZoom(1., event->pos()); | ||
326 | } | 326 | } | ||
327 | return; | 327 | return; | ||
328 | } | 328 | } | ||
329 | 329 | | |||
330 | if (event->modifiers() & Qt::ControlModifier) { | 330 | if (event->modifiers() & Qt::ControlModifier) { | ||
331 | if (event->button() == Qt::LeftButton) { | 331 | if (event->button() == Qt::LeftButton) { | ||
332 | zoomInRequested(event->pos()); | 332 | zoomInRequested(event->pos()); | ||
333 | return; | 333 | return; | ||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |