#include "QxGraph.h"
#include <qpoint.h>
+#include <qwmatrix.h>
class QXGRAPH_EXPORT QxGraph_ActiveItem
{
virtual void showPopup() = 0;
virtual QString getToolTipText(const QPoint& theMousePos, QRect& theRect) const = 0;
+
+ void setTMatrix(QWMatrix theMatrix) { myTMatrix = theMatrix; }
+ QWMatrix getTMatrix() const { return myTMatrix; }
+
+ private:
+ QWMatrix myTMatrix; // canvas view's current transformation matrix
};
#endif
QWMatrix m = worldMatrix();
m.scale(s, s);
setWorldMatrix(m);
-
+
+ // remember the canvas view's current transformation matrix in all canvas items
+ QCanvasItemList aList = canvas()->allItems();
+ for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
+ QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+ if ( anActItem ) anActItem->setTMatrix(m);
+ }
+
myGlobalPoint = aGlobalPoint;
return;
}
QWMatrix m;
m.scale(aXzoom, aXzoom);
setWorldMatrix(m);
+
+ // remember the canvas view's current transformation matrix in all canvas items
+ QCanvasItemList aList = canvas()->allItems();
+ for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
+ QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+ if ( anActItem ) anActItem->setTMatrix(m);
+ }
+
setContentsPos((int)(aLX*aXzoom), (int)(aTY*aYzoom));
canvas()->update();
QWMatrix m;
m.scale(s, s);
setWorldMatrix(m);
+
+ // remember the canvas view's current transformation matrix in all canvas items
+ QCanvasItemList aList = canvas()->allItems();
+ for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
+ QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+ if ( anActItem ) anActItem->setTMatrix(m);
+ }
+
canvas()->update();
//myOperation = NOTHING;
}
setContentsPos(0,0);
QWMatrix m;
setWorldMatrix(m);
+
+ // remember the canvas view's current transformation matrix in all canvas items
+ QCanvasItemList aList = canvas()->allItems();
+ for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
+ QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+ if ( anActItem ) anActItem->setTMatrix(m);
+ }
+
//myOperation = NOTHING;
}