Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes rubberBand for extent selection in gdal_clipper and sextante algs
  • Loading branch information
slarosa committed Feb 8, 2013
1 parent c90870d commit 8303a47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/plugins/GdalTools/tools/extentSelector.py
Expand Up @@ -130,7 +130,7 @@ def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas)

self.rubberBand = QgsRubberBand( self.canvas, True ) # true, its a polygon
self.rubberBand = QgsRubberBand( self.canvas, QGis.Polygon )
self.rubberBand.setColor( Qt.red )
self.rubberBand.setWidth( 1 )

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

def canvasPressEvent(self, e):
self.startPoint = self.toMapCoordinates( e.pos() )
Expand All @@ -161,7 +161,7 @@ def canvasMoveEvent(self, e):
self.showRect(self.startPoint, self.endPoint)

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

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/sextante/gui/RectangleMapTool.py
Expand Up @@ -34,7 +34,7 @@ def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas)

self.rubberBand = QgsRubberBand( self.canvas, True ) # true, its a polygon
self.rubberBand = QgsRubberBand( self.canvas, QGis.Polygon )
self.rubberBand.setColor( Qt.red )
self.rubberBand.setWidth( 1 )

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

def canvasPressEvent(self, e):
self.startPoint = self.toMapCoordinates( e.pos() )
Expand All @@ -65,7 +65,7 @@ def canvasMoveEvent(self, e):
self.showRect(self.startPoint, self.endPoint)

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

Expand Down

0 comments on commit 8303a47

Please sign in to comment.