mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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:
parent
2c97100de5
commit
cc3255c3a5
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user