Skip to content
Permalink
Browse files
Merge pull request #424 from slarosa/fix_rubber_band_python_plugins
Fixes rubberBand for extent selection in gdal_clipper and sextante algs
  • Loading branch information
brushtyler committed Feb 9, 2013
2 parents 5967db9 + 8303a47 commit 80240d80de25b599120a3e21c78c273d22ee66a2
Showing with 6 additions and 6 deletions.
  1. +3 −3 python/plugins/GdalTools/tools/extentSelector.py
  2. +3 −3 python/plugins/sextante/gui/RectangleMapTool.py
@@ -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 )

@@ -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() )
@@ -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

@@ -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 )

@@ -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() )
@@ -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

0 comments on commit 80240d8

Please sign in to comment.