Skip to content

Commit 80240d8

Browse files
committedFeb 9, 2013
Merge pull request #424 from slarosa/fix_rubber_band_python_plugins
Fixes rubberBand for extent selection in gdal_clipper and sextante algs
2 parents 5967db9 + 8303a47 commit 80240d8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎python/plugins/GdalTools/tools/extentSelector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self, canvas):
130130
self.canvas = canvas
131131
QgsMapToolEmitPoint.__init__(self, self.canvas)
132132

133-
self.rubberBand = QgsRubberBand( self.canvas, True ) # true, its a polygon
133+
self.rubberBand = QgsRubberBand( self.canvas, QGis.Polygon )
134134
self.rubberBand.setColor( Qt.red )
135135
self.rubberBand.setWidth( 1 )
136136

@@ -139,7 +139,7 @@ def __init__(self, canvas):
139139
def reset(self):
140140
self.startPoint = self.endPoint = None
141141
self.isEmittingPoint = False
142-
self.rubberBand.reset( True ) # true, its a polygon
142+
self.rubberBand.reset( QGis.Polygon )
143143

144144
def canvasPressEvent(self, e):
145145
self.startPoint = self.toMapCoordinates( e.pos() )
@@ -161,7 +161,7 @@ def canvasMoveEvent(self, e):
161161
self.showRect(self.startPoint, self.endPoint)
162162

163163
def showRect(self, startPoint, endPoint):
164-
self.rubberBand.reset( True ) # true, it's a polygon
164+
self.rubberBand.reset( QGis.Polygon )
165165
if startPoint.x() == endPoint.x() or startPoint.y() == endPoint.y():
166166
return
167167

‎python/plugins/sextante/gui/RectangleMapTool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, canvas):
3434
self.canvas = canvas
3535
QgsMapToolEmitPoint.__init__(self, self.canvas)
3636

37-
self.rubberBand = QgsRubberBand( self.canvas, True ) # true, its a polygon
37+
self.rubberBand = QgsRubberBand( self.canvas, QGis.Polygon )
3838
self.rubberBand.setColor( Qt.red )
3939
self.rubberBand.setWidth( 1 )
4040

@@ -43,7 +43,7 @@ def __init__(self, canvas):
4343
def reset(self):
4444
self.startPoint = self.endPoint = None
4545
self.isEmittingPoint = False
46-
self.rubberBand.reset( True ) # true, its a polygon
46+
self.rubberBand.reset( QGis.Polygon )
4747

4848
def canvasPressEvent(self, e):
4949
self.startPoint = self.toMapCoordinates( e.pos() )
@@ -65,7 +65,7 @@ def canvasMoveEvent(self, e):
6565
self.showRect(self.startPoint, self.endPoint)
6666

6767
def showRect(self, startPoint, endPoint):
68-
self.rubberBand.reset( True ) # true, it's a polygon
68+
self.rubberBand.reset( QGis.Polygon )
6969
if startPoint.x() == endPoint.x() or startPoint.y() == endPoint.y():
7070
return
7171

0 commit comments

Comments
 (0)
Please sign in to comment.