patch_for_bug_1907.txt

A way to avoid the strange selection - gcarrillo -, 2009-08-29 09:28 PM

Download (697 Bytes)

 
1
Index: src/app/qgsmaptoolselect.cpp
2
===================================================================
3
--- src/app/qgsmaptoolselect.cpp	(revision: 11524)
4
+++ src/app/qgsmaptoolselect.cpp	(copia de trabajo)
5
@@ -101,9 +101,16 @@
6
   {
7
     delete mRubberBand;
8
     mRubberBand = 0;
9
-    // store the rectangle
10
-    mSelectRect.setRight( e->pos().x() );
11
-    mSelectRect.setBottom( e->pos().y() );
12
+
13
+    // Set valid values for rectangle's width and height
14
+    if ( mSelectRect.width() == 1 )
15
+    {
16
+      mSelectRect.setLeft( mSelectRect.left() + 1 );
17
+    }
18
+    if ( mSelectRect.height() == 1 )
19
+    {
20
+      mSelectRect.setBottom( mSelectRect.bottom() + 1 );
21
+    }
22
   }
23

    
24
   mDragging = FALSE;