Version: 1.2.0_devel (using KDE KDE 3.4.0) OS: Linux It would be convienient to have (as a configurable option, in Configure Kst) the guide lines that are drawn when you are in the process of a zoom in x mouse zoom or y mouse zoom to be drawn all the time when you are in one of those zoom modes, not just during an active zoom process. Motivation: I believe that most kst users use xy mouse zoom mode as the standard (default) operating mode, and only enter x or y zoom modes temporarily and through the shift of ctrl shortcuts. Currently, in x or y zoom modes, as soon as you start a zoom a horizontal or vertical dotted line appears on the plot to indicate one of the new boundaries, and another one appears and follows the mouse to help the user better position the second boundary. If the dotted line that follows the mouse always appears (and follows the mouse) when in x or y zoom mode, the user will be able to easily (and more accuratly) place both boundary points exactly where they want to, not just the second. Desired behavior: When in xy mouse mode, nothing changes from the current behavior. When the user enters x mouse zoom (for example) the vertical dotted line that follows the mouse instantly appears. The user can then accuratly place the first boundary point, click, and then set the second as in the current behavior. As soon as the user returns to xy mouse zoom, the dotted line that follows the mouse disappears.
Implemented in trunk, but still a bit buggy. If you find any ways to cause artifacts, please report with a mechanism to reproduce it.
I'm going to reopen this bug as one tiny part was not implimented. Currently, the 'guidelines' are displayed when you enter X or Y zoom mode with the mouse menu (by clicking on the toolbar as appropriate), and when you use the function keys (F3 and F4), but *not* when you are in XY zoom mode and quickly enter X or Y zoom mode with the shift and ctrl keys. It would be best if the guidelines were also displayed for the first step of zooming when shift or ctrl is pressed.
I agree: the guide lines should always be shown if you are in the mode, even if you are in it using a modifier key.
SVN commit 568496 by staikos: draw the guidelines when using the modifier keys too FEATURE: 111241 M +37 -5 kst2dplot.cpp M +1 -0 kst2dplot.h --- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #568495:568496 @@ -2392,10 +2392,13 @@ } KstMouseModeType gzType = globalZoomType(); - if (view && (gzType == X_ZOOMBOX || gzType == Y_ZOOMBOX)) { - if (GetPlotRegion().contains(_mouse.tracker)) { + if (view && GetPlotRegion().contains(_mouse.tracker)) { + if (gzType == X_ZOOMBOX || gzType == Y_ZOOMBOX) { updateXYGuideline(view, QPoint(-1, -1), view->mapFromGlobal(QCursor::pos()), GetPlotRegion(), gzType); _mouse.lastGuideline = view->mapFromGlobal(QCursor::pos()); + } else if (gzType == XY_ZOOMBOX) { + updateXYGuideline(view, QPoint(-1, -1), view->mapFromGlobal(QCursor::pos()), GetPlotRegion(), gzType); + _mouse.lastGuideline = view->mapFromGlobal(QCursor::pos()); } } } @@ -3990,20 +3993,29 @@ p.setRasterOp(Qt::NotROP); if (gzType == X_ZOOMBOX) { if (pr.contains(oldPos)) { - p.drawLine(oldPos.x(), pr.top(), oldPos.x(), pr.bottom()); + if (_mouse.lastGuidelineType == X_ZOOMBOX) { + p.drawLine(oldPos.x(), pr.top(), oldPos.x(), pr.bottom()); + } else if (_mouse.lastGuidelineType == Y_ZOOMBOX) { + p.drawLine(pr.left(), oldPos.y(), pr.right(), oldPos.y()); + } } if (pr.contains(newPos)) { p.drawLine(newPos.x(), pr.top(), newPos.x(), pr.bottom()); } } else { if (pr.contains(oldPos)) { - p.drawLine(pr.left(), oldPos.y(), pr.right(), oldPos.y()); + if (_mouse.lastGuidelineType == X_ZOOMBOX) { + p.drawLine(oldPos.x(), pr.top(), oldPos.x(), pr.bottom()); + } else if (_mouse.lastGuidelineType == Y_ZOOMBOX) { + p.drawLine(pr.left(), oldPos.y(), pr.right(), oldPos.y()); + } } if (pr.contains(newPos)) { p.drawLine(pr.left(), newPos.y(), pr.right(), newPos.y()); } } p.end(); + _mouse.lastGuidelineType = gzType; } @@ -4023,13 +4035,32 @@ KstMouseModeType gzType = globalZoomType(); // Draw a helper guide in X or Y zoom modes if (gzType == X_ZOOMBOX || gzType == Y_ZOOMBOX) { - if (e->state() == 0) { + ButtonState s = e->stateAfter(); + if (s == 0) { updateXYGuideline(view, _mouse.lastGuideline, _mouse.tracker, pr, gzType); _mouse.lastGuideline = _mouse.tracker; + } else if (s & Qt::ShiftButton) { + updateXYGuideline(view, _mouse.lastGuideline, _mouse.tracker, pr, Y_ZOOMBOX); + _mouse.lastGuideline = _mouse.tracker; + } else if (s & Qt::ControlButton) { + updateXYGuideline(view, _mouse.lastGuideline, _mouse.tracker, pr, X_ZOOMBOX); + _mouse.lastGuideline = _mouse.tracker; } else { updateXYGuideline(view, _mouse.lastGuideline, QPoint(-1, -1), pr, gzType); _mouse.lastGuideline = QPoint(-1, -1); } + } else if (gzType == XY_ZOOMBOX) { + ButtonState s = e->stateAfter(); + if (s & Qt::ShiftButton) { + updateXYGuideline(view, _mouse.lastGuideline, _mouse.tracker, pr, Y_ZOOMBOX); + _mouse.lastGuideline = _mouse.tracker; + } else if (s & Qt::ControlButton) { + updateXYGuideline(view, _mouse.lastGuideline, _mouse.tracker, pr, X_ZOOMBOX); + _mouse.lastGuideline = _mouse.tracker; + } else { + updateXYGuideline(view, _mouse.lastGuideline, QPoint(-1, -1), pr, gzType); + _mouse.lastGuideline = QPoint(-1, -1); + } } // Note: we have one report of a system where this clip region is invalid @@ -4320,6 +4351,7 @@ lastLocation = QPoint(-1, -1); tracker = QPoint(-1, -1); lastGuideline = QPoint(-1, -1); + lastGuidelineType = XY_ZOOMBOX; } --- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.h #568495:568496 @@ -73,6 +73,7 @@ QPoint lastLocation, pressLocation; // for zooming primarily QPoint tracker; // for tracking the mouse location QPoint lastGuideline; // for tracking the last guideline location + KstMouseModeType lastGuidelineType; QRect plotGeometry; bool zooming() const; void zoomStart(KstMouseModeType t, const QPoint& location);
In XY zoom mode a horizontal guideline is left on a plot after any of the following: XY zoom using only the mouse Vertical zoom using the modifier key Horizontal zoom using the modifier key
File a new bug