Summary: | Ability to have guide lines always drawn when in 'x mouse zoom' or 'y mouse zoom' | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Matthew Truch <matt> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Matthew Truch
2005-08-21 20:21:57 UTC
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 |