diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2019-04-10 19:09:38 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-04-11 08:39:24 +0000 |
commit | d92b976f7d092a31c67edc2c515ac2444cd2808d (patch) | |
tree | 18ec087703b30bdc13d0d48e1acad19a986946c9 | |
parent | 66743ae97387da43dc6f27e5237ec472edae35f5 (diff) |
Pixeltool: Fix some subpixel mode pitfalls
Switching to one of the subpixel modes while having a zoomfactor below 3
made increasing the zoom (via context menu) impossible.
Also, increasing/decreasing the zoom level via +/- keys did not happen
in steps by 3 like when increasing/decreasing via context menu.
Change-Id: Ibf69bc6247c74b960614b99df81a227ca57f5d5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/pixeltool/qpixeltool.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pixeltool/qpixeltool.cpp b/src/pixeltool/qpixeltool.cpp index 7a73e3655..0e2745a5d 100644 --- a/src/pixeltool/qpixeltool.cpp +++ b/src/pixeltool/qpixeltool.cpp @@ -298,10 +298,10 @@ void QPixelTool::keyPressEvent(QKeyEvent *e) toggleFreeze(); break; case Qt::Key_Plus: - setZoom(m_zoom + 1); + increaseZoom(); break; case Qt::Key_Minus: - setZoom(m_zoom - 1); + decreaseZoom(); break; case Qt::Key_PageUp: setGridSize(m_gridSize + 1); @@ -491,7 +491,7 @@ void QPixelTool::contextMenuEvent(QContextMenuEvent *e) // LCD mode looks off unless zoom is dividable by 3 if (m_lcdMode && m_zoom % 3) - setZoom((m_zoom + 1) / 3); + setZoom(qMax(3, (m_zoom + 1) / 3)); } QSize QPixelTool::sizeHint() const |