Skip to content

Commit

Permalink
Fix for ticket #212. Problem was caused by two un-initialised
Browse files Browse the repository at this point in the history
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
  • Loading branch information
g_j_m committed Jul 31, 2006
1 parent 2c97100 commit cc3255c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/composer/qgscomposition.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit cc3255c

Please sign in to comment.