Fix Zoom out [skip ci]

Fix #93
master
huxingyi 2020-10-14 22:55:30 +09:30
parent aa5c0c90c7
commit 20f370422c
1 changed files with 6 additions and 6 deletions

View File

@ -1516,18 +1516,18 @@ bool SkeletonGraphicsWidget::mousePress(QMouseEvent *event)
if (SkeletonDocumentEditMode::ZoomIn == m_document->editMode) { if (SkeletonDocumentEditMode::ZoomIn == m_document->editMode) {
ViewportAnchor lastAnchor = transformationAnchor(); ViewportAnchor lastAnchor = transformationAnchor();
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
scale(1.5, 1.5); scale(1.25, 1.25);
setTransformationAnchor(lastAnchor); setTransformationAnchor(lastAnchor);
return true; return true;
} else if (SkeletonDocumentEditMode::ZoomOut == m_document->editMode) { } else if (SkeletonDocumentEditMode::ZoomOut == m_document->editMode) {
ViewportAnchor lastAnchor = transformationAnchor(); ViewportAnchor lastAnchor = transformationAnchor();
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
scale(0.5, 0.5); scale(0.8, 0.8);
setTransformationAnchor(lastAnchor); setTransformationAnchor(lastAnchor);
if ((!verticalScrollBar() || !verticalScrollBar()->isVisible()) && //if ((!verticalScrollBar() || !verticalScrollBar()->isVisible()) &&
(!horizontalScrollBar() || !horizontalScrollBar()->isVisible())) { // (!horizontalScrollBar() || !horizontalScrollBar()->isVisible())) {
setTransform(QTransform()); // setTransform(QTransform());
} //}
return true; return true;
} else if (SkeletonDocumentEditMode::Drag == m_document->editMode) { } else if (SkeletonDocumentEditMode::Drag == m_document->editMode) {
if (!m_dragStarted) { if (!m_dragStarted) {