Skip to content

Commit 7b6032e

Browse files
author
g_j_m
committed
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
1 parent 1d7a6d2 commit 7b6032e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/composer/qgscomposition.cpp

+15-3
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
232232
QPoint p = mView->inverseWorldMatrix().map(e->pos());
233233
mLastPoint = p;
234234

235+
double x,y;
236+
mView->inverseWorldMatrix().map( e->pos().x(), e->pos().y(), &x, &y );
237+
235238
switch ( mTool ) {
236239
case Select:
237240
{
238241
Q3CanvasItemList l = mCanvas->collisions(p);
239242

240-
double x,y;
241-
mView->inverseWorldMatrix().map( e->pos().x(), e->pos().y(), &x, &y );
242-
243243
Q3CanvasItem * newItem = 0;
244244

245245
for ( Q3CanvasItemList::Iterator it=l.fromLast(); it!=l.end(); --it) {
@@ -308,6 +308,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
308308
mSelectedItem = dynamic_cast <Q3CanvasItem*> (vl);
309309

310310
mCanvas->update();
311+
312+
// Remember this position for later
313+
mLastX = x;
314+
mLastY = y;
311315
}
312316
break;
313317

@@ -327,6 +331,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
327331
mSelectedItem = dynamic_cast <Q3CanvasItem*> (lab);
328332

329333
mCanvas->update();
334+
335+
// Remember this position for later
336+
mLastX = x;
337+
mLastY = y;
330338
}
331339
break;
332340

@@ -346,6 +354,10 @@ void QgsComposition::contentsMousePressEvent(QMouseEvent* e)
346354
mSelectedItem = dynamic_cast <Q3CanvasItem*> (sb);
347355

348356
mCanvas->update();
357+
358+
// Remember this position for later
359+
mLastX = x;
360+
mLastY = y;
349361
}
350362
break;
351363

0 commit comments

Comments
 (0)