[Kst] extragear/graphics/kst/kst
Andrew Walker
arwalker at sumusltd.com
Wed Nov 23 00:45:00 CET 2005
SVN commit 482455 by arwalker:
Ensure that the resizing of newly created notation objects is the same as for resizing existing notation objects. In essence this keeps newly created objects within the plot region, so that an assert on this in KstViewObject is not triggered.
M +1 -1 kstgfxmousehandler.h
M +3 -2 kstgfxtextmousehandler.cpp
M +1 -1 kstgfxtextmousehandler.h
--- trunk/extragear/graphics/kst/kst/kstgfxmousehandler.h #482454:482455
@@ -34,7 +34,7 @@
~KstGfxMouseHandler();
virtual void handlePress(const QPoint& pos, bool shift);
- virtual void pressMove(const QPoint& pos, bool shift) = 0;
+ virtual void pressMove(const QPoint& pos, bool shift, const QRect& geom) = 0;
virtual void releasePress(const QPoint& pos, bool shift) = 0;
virtual void updateFocus(const QPoint& pos);
virtual void cancelMouseOperations();
--- trunk/extragear/graphics/kst/kst/kstgfxtextmousehandler.cpp #482454:482455
@@ -43,7 +43,7 @@
}
-void KstGfxTextMouseHandler::pressMove(const QPoint& pos, bool shift) {
+void KstGfxTextMouseHandler::pressMove(const QPoint& pos, bool shift, const QRect& geom) {
if (_cancelled || !_mouseDown) {
return;
}
@@ -51,7 +51,8 @@
QRect old = _prevBand;
_prevBand = KstGfxMouseHandlerUtils::newRect(pos, _mouseOrigin, shift);
-
+ _prevBand = _prevBand.intersect(geom);
+
if (old != _prevBand) {
QPainter p;
p.begin(_top->widget());
--- trunk/extragear/graphics/kst/kst/kstgfxtextmousehandler.h #482454:482455
@@ -26,7 +26,7 @@
KstGfxTextMouseHandler(KstTopLevelViewPtr top);
~KstGfxTextMouseHandler();
- void pressMove(const QPoint& pos, bool shift);
+ void pressMove(const QPoint& pos, bool shift, const QRect& geom);
void releasePress(const QPoint& pos, bool shift);
};
More information about the Kst
mailing list