Fix for ticket #212. Problem was caused by two un-initialised

variables that stored the coordinates of the cursor prior to the
current mouse move. They were un-initialised only for the first mouse
move after a mouse button down event.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5651 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-07-31 01:10:56 +00:00
parent 2c97100de5
commit cc3255c3a5

View File

@ -232,14 +232,14 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
QPoint p = mView->inverseWorldMatrix().map(e->pos());
mLastPoint = p;
double x,y;
mView->inverseWorldMatrix().map( e->pos().x(), e->pos().y(), &x, &y );
switch ( mTool ) {
case Select:
{
Q3CanvasItemList l = mCanvas->collisions(p);
double x,y;
mView->inverseWorldMatrix().map( e->pos().x(), e->pos().y(), &x, &y );
Q3CanvasItem * newItem = 0;
for ( Q3CanvasItemList::Iterator it=l.fromLast(); it!=l.end(); --it) {
@ -308,6 +308,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
mSelectedItem = dynamic_cast <Q3CanvasItem*> (vl);
mCanvas->update();
// Remember this position for later
mLastX = x;
mLastY = y;
}
break;
@ -327,6 +331,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
mSelectedItem = dynamic_cast <Q3CanvasItem*> (lab);
mCanvas->update();
// Remember this position for later
mLastX = x;
mLastY = y;
}
break;
@ -346,6 +354,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
mSelectedItem = dynamic_cast <Q3CanvasItem*> (sb);
mCanvas->update();
// Remember this position for later
mLastX = x;
mLastY = y;
}
break;