Commit 22106779 authored by Ralf Habacker's avatar Ralf Habacker

Fix bug showing huge zoom values in case diagrams are empty or contains only a few items.

BUG:359774
FIXED-IN:2.18.3 (KDE Applications 15.12.3)
parent d63a6874
......@@ -668,6 +668,10 @@ void UMLApp::slotZoomSliderMoved(int value)
void UMLApp::slotZoomFit()
{
QRectF items = currentView()->umlScene()->itemsBoundingRect();
if (items.isNull()) {
setZoom(100);
return;
}
currentView()->umlScene()->setSceneRect(items);
// TODO: QGraphicsView seems not to be informed about the scene rect update
currentView()->setSceneRect(items);
......@@ -681,7 +685,13 @@ void UMLApp::slotZoomFit()
else {
scale = scaleH;
}
setZoom(scale-2);
if (scale < 0)
scale = 100;
else if (scale > 500)
scale = 500;
else
scale -= 2;
setZoom(scale);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment