[Kst] branches/work/kst/portto4/kst/src/libkstapp
Mike Fenton
mike at staikos.net
Fri Mar 28 18:36:36 CET 2008
SVN commit 791195 by fenton:
Fix Selection Rect drawing for Zoom.
Fix delay in plot item rect updates when changing zoom state.
M +1 -1 plotitem.cpp
M +21 -7 plotrenderitem.cpp
M +2 -0 plotrenderitem.h
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #791194:791195
@@ -2354,7 +2354,7 @@
if (rect != _projectionRect) {
_projectionRect = rect;
- emit projectionRectChanged();
+// emit projectionRectChanged();
update(); //slow, but need to update everything...
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #791194:791195
@@ -488,9 +488,7 @@
}
ViewItem::keyPressEvent(event);
- if (_selectionRect.isValid()) {
- update(); //FIXME should optimize instead of redrawing entire curve?
- }
+ updateSelectionRect();
}
@@ -501,11 +499,25 @@
} else if (modifiers & Qt::ControlModifier) {
setCursor(Qt::SizeHorCursor);
} else {
+ resetSelectionRect();
+ }
+ ViewItem::keyReleaseEvent(event);
+}
+
+
+void PlotRenderItem::resetSelectionRect() {
+ if (_selectionRect.isValid()) {
_selectionRect.reset();
updateCursor(_lastPos);
+ updateSelectionRect();
+ }
+}
+
+
+void PlotRenderItem::updateSelectionRect() {
+ if (_selectionRect.isValid()) {
update(); //FIXME should optimize instead of redrawing entire curve?
}
- ViewItem::keyReleaseEvent(event);
}
@@ -525,9 +537,7 @@
_selectionRect.setTo(p);
}
- if (_selectionRect.isValid()) {
- update(); //FIXME should optimize instead of redrawing entire curve?
- }
+ updateSelectionRect();
}
@@ -669,6 +679,7 @@
void PlotRenderItem::zoomXOut() {
qDebug() << "zoomXOut" << endl;
+ resetSelectionRect();
ZoomCommand *cmd = new ZoomXOutCommand(this);
cmd->redo();
}
@@ -676,6 +687,7 @@
void PlotRenderItem::zoomXIn() {
qDebug() << "zoomXIn" << endl;
+ resetSelectionRect();
ZoomCommand *cmd = new ZoomXInCommand(this);
cmd->redo();
}
@@ -730,6 +742,7 @@
void PlotRenderItem::zoomYOut() {
qDebug() << "zoomYOut" << endl;
+ resetSelectionRect();
ZoomCommand *cmd = new ZoomYOutCommand(this);
cmd->redo();
}
@@ -737,6 +750,7 @@
void PlotRenderItem::zoomYIn() {
qDebug() << "zoomYIn" << endl;
+ resetSelectionRect();
ZoomCommand *cmd = new ZoomYInCommand(this);
cmd->redo();
}
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.h #791194:791195
@@ -134,6 +134,8 @@
private:
void createActions();
void updateCursor(const QPointF &pos);
+ void resetSelectionRect();
+ void updateSelectionRect();
ZoomState currentZoomState();
void setCurrentZoomState(ZoomState zoomState);
More information about the Kst
mailing list