Skip to content
Permalink
Browse files

Use fixed 2px pen width for rubber bands and vertex markers. (The pre…

…vious default 10px was just too much)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12598 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Dec 23, 2009
1 parent 6cc7da0 commit c645d4d0d8148ab4dd80f1399d0026caf0d4fe0f
@@ -88,39 +88,39 @@ def __init__(self, plugin):

# initializing rubberbands/vertexmarkers; getting qgis settings of line width and color for rubberbands
settings=QSettings()
qgsLineWidth=settings.value( "/qgis/digitizing/line_width", QVariant(10) ).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value( "/qgis/digitizing/line_color_red", QVariant(255) ).toInt()
qgsLineGreen=settings.value( "/qgis/digitizing/line_color_green", QVariant(0) ).toInt()
qgsLineBlue=settings.value( "/qgis/digitizing/line_color_blue", QVariant(0) ).toInt()

self.rubBandPol=QgsRubberBand(plugin.canvas,True)
self.rubBandPol.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
self.rubBandPol.setWidth(qgsLineWidth[0])
self.rubBandPol.setWidth(qgsLineWidth)

self.rubBand=QgsRubberBand(plugin.canvas,False)
self.rubBand.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
self.rubBand.setWidth(qgsLineWidth[0])
self.rubBand.setWidth(qgsLineWidth)

self.verMarker=QgsVertexMarker(plugin.canvas)
self.verMarker.setIconType(2)
self.verMarker.setIconSize(13)
self.verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
self.verMarker.setPenWidth(qgsLineWidth[0])
self.verMarker.setPenWidth(qgsLineWidth)
self.verMarkers=[]

self.relRubBandPol=QgsRubberBand(plugin.canvas,True)
self.relRubBandPol.setColor(QColor(qgsLineRed[0],50,50))
self.relRubBandPol.setWidth(qgsLineWidth[0]+4)
self.relRubBandPol.setWidth(qgsLineWidth+4)

self.relRubBand=QgsRubberBand(plugin.canvas,False)
self.relRubBand.setColor(QColor(qgsLineRed[0],50,50))
self.relRubBand.setWidth(qgsLineWidth[0]+4)
self.relRubBand.setWidth(qgsLineWidth+4)

self.relVerMarker=QgsVertexMarker(plugin.canvas)
self.relVerMarker.setIconType(2)
self.relVerMarker.setIconSize(13)
self.relVerMarker.setColor(QColor(qgsLineRed[0],50,50))
self.relVerMarker.setPenWidth(qgsLineWidth[0])
self.relVerMarker.setPenWidth(qgsLineWidth)

# initializing inner variables
self.activeEditButton=self.dummyButton
@@ -1076,7 +1076,7 @@ def putMarkersOnMembers(self,feat,featType):

# get qgis settings of line width and color for rubberband
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()
@@ -1086,7 +1086,7 @@ def putMarkersOnMembers(self,feat,featType):
verMarker.setIconType(3)
verMarker.setIconSize(6)
verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
verMarker.setPenWidth(qgsLineWidth[0])
verMarker.setPenWidth(qgsLineWidth)
verMarker.setCenter(pline[i])
verMarker.show()
self.verMarkers.append(verMarker)
@@ -99,14 +99,14 @@ def createLineRubberband(self):

# get qgis settings of line width and color for rubberband
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()

rband=QgsRubberBand(self.canvas,False)
rband.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
rband.setWidth(qgsLineWidth[0])
rband.setWidth(qgsLineWidth)

return rband

@@ -120,7 +120,7 @@ def createSnapVertexMarker(self):

# get qgis settings
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()
@@ -129,7 +129,7 @@ def createSnapVertexMarker(self):
verMarker.setIconType(2)
verMarker.setIconSize(13)
verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
verMarker.setPenWidth(qgsLineWidth[0])
verMarker.setPenWidth(qgsLineWidth)
verMarker.setCenter(QgsPoint(-1000,-1000))

return verMarker
@@ -96,7 +96,7 @@ def createVertexMarker(self):

# get qgis settings
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()
@@ -105,7 +105,7 @@ def createVertexMarker(self):
verMarker.setIconType(2)
verMarker.setIconSize(13)
verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
verMarker.setPenWidth(qgsLineWidth[0])
verMarker.setPenWidth(qgsLineWidth)
verMarker.setCenter(QgsPoint(-1000,-1000))

return verMarker
@@ -99,14 +99,14 @@ def createPolygonRubberband(self):

# get qgis settings of line width and color for rubberband
settings = QSettings()
qgsLineWidth = settings.value( "/qgis/digitizing/line_width", QVariant(10) ).toInt()
qgsLineWidth = 2 # use fixed width
qgsLineRed = settings.value( "/qgis/digitizing/line_color_red", QVariant(255) ).toInt()
qgsLineGreen = settings.value( "/qgis/digitizing/line_color_green", QVariant(0) ).toInt()
qgsLineBlue = settings.value( "/qgis/digitizing/line_color_blue", QVariant(0) ).toInt()

rband=QgsRubberBand(self.canvas,True)
rband.setColor( QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]) )
rband.setWidth( qgsLineWidth[0] )
rband.setWidth( qgsLineWidth )

return rband

@@ -120,7 +120,7 @@ def createSnapVertexMarker(self):

# get qgis settings
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()
@@ -129,7 +129,7 @@ def createSnapVertexMarker(self):
verMarker.setIconType(2)
verMarker.setIconSize(13)
verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
verMarker.setPenWidth(qgsLineWidth[0])
verMarker.setPenWidth(qgsLineWidth)
verMarker.setCenter(QgsPoint(-1000,-1000))

return verMarker
@@ -186,14 +186,14 @@ def __createFeatRubberband(self,isPolygon):

# get qgis settings of line width and color for rubberband
settings=QSettings()
qgsLineWidth=settings.value( "/qgis/digitizing/line_width", QVariant(10) ).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value( "/qgis/digitizing/line_color_red", QVariant(255) ).toInt()
qgsLineGreen=settings.value( "/qgis/digitizing/line_color_green", QVariant(0) ).toInt()
qgsLineBlue=settings.value( "/qgis/digitizing/line_color_blue", QVariant(0) ).toInt()

rband=QgsRubberBand(self.canvas,isPolygon)
rband.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
rband.setWidth( qgsLineWidth[0] )
rband.setWidth( qgsLineWidth )

return rband

@@ -207,11 +207,11 @@ def __createSnapRubberband(self):

# get qgis settings of line width and color for rubberband
settings=QSettings()
qgsLineWidth=settings.value( "/qgis/digitizing/line_width", QVariant(10) ).toInt()
qgsLineWidth=2 # use fixed width

rband=QgsRubberBand(self.canvas,False)
rband.setColor(QColor(255,0,0))
rband.setWidth(qgsLineWidth[0])
rband.setWidth(qgsLineWidth)

return rband

@@ -224,7 +224,7 @@ def __createVertexMarker(self):

# get qgis settings
settings=QSettings()
qgsLineWidth=settings.value("/qgis/digitizing/line_width",QVariant(10)).toInt()
qgsLineWidth=2 # use fixed width
qgsLineRed=settings.value("/qgis/digitizing/line_color_red",QVariant(255)).toInt()
qgsLineGreen=settings.value("/qgis/digitizing/line_color_green",QVariant(0)).toInt()
qgsLineBlue=settings.value("/qgis/digitizing/line_color_blue",QVariant(0)).toInt()
@@ -233,7 +233,7 @@ def __createVertexMarker(self):
verMarker.setIconType(2)
verMarker.setIconSize(13)
verMarker.setColor(QColor(qgsLineRed[0],qgsLineGreen[0],qgsLineBlue[0]))
verMarker.setPenWidth(qgsLineWidth[0])
verMarker.setPenWidth(qgsLineWidth)
verMarker.setCenter(QgsPoint(-1000,-1000))

return verMarker

0 comments on commit c645d4d

Please sign in to comment.
You can’t perform that action at this time.