Skip to content
Permalink
Browse files
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/qgis@5651 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 31, 2006
1 parent 1d7a6d2 commit 7b6032e4fb9f883f48b49e7e9124cc1a0807fc56
Showing with 15 additions and 3 deletions.
  1. +15 −3 src/composer/qgscomposition.cpp
@@ -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;

0 comments on commit 7b6032e

Please sign in to comment.