Skip to content

Commit

Permalink
Use fixed 2px pen width for rubber bands and vertex markers. (The pre…
Browse files Browse the repository at this point in the history
…vious default 10px was just too much)

git-svn-id: http://svn.osgeo.org/qgis/trunk@12598 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 23, 2009
1 parent 7d175fb commit bacd4fe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions python/plugins/osm/OsmFeatureDW.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/osm/map_tools/OsmCreateLineMT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/osm/map_tools/OsmCreatePointMT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/osm/map_tools/OsmCreatePolygonMT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions python/plugins/osm/map_tools/OsmMoveMT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit bacd4fe

Please sign in to comment.