Implemented a global setting for marker size and support of it for snapping in "Draft" workbench. In future this setting can be used for other markers too, to be able to set them all to comfortable size by just one global setting.

Before that (e.g. on MacBook Pro) it was very hard to see the microscopic selection-circle hidden behind much bigger cursor arrow when trying to snap e.g. a line to some vertex. Now this setting can be used for such displays to increase the marker size and make it clearly visible behind the cursor.
The already existing "sketcher marker size" property is intended to be used for sketcher only, so it's not suitable for global setup of all the markers' sizes uniformly...
This commit is contained in:
JimStar
2018-07-04 15:39:12 +12:00
committed by Yorik van Havre
parent 2f6fe25971
commit e5dc8bfffa
6 changed files with 403 additions and 25 deletions

View File

@@ -116,7 +116,7 @@ class snapTracker(Tracker):
color = coin.SoBaseColor()
color.rgb = FreeCADGui.draftToolBar.getDefaultColor("snap")
self.marker = coin.SoMarkerSet() # this is the marker symbol
self.marker.markerIndex = coin.SoMarkerSet.CIRCLE_FILLED_9_9
self.marker.markerIndex = FreeCADGui.getMarkerIndex("")
self.coords = coin.SoCoordinate3() # this is the coordinate
self.coords.point.setValue((0,0,0))
node = coin.SoAnnotation()
@@ -126,18 +126,7 @@ class snapTracker(Tracker):
Tracker.__init__(self,children=[node],name="snapTracker")
def setMarker(self,style):
if (style == "square"):
self.marker.markerIndex = coin.SoMarkerSet.DIAMOND_FILLED_9_9
elif (style == "circle"):
self.marker.markerIndex = coin.SoMarkerSet.CIRCLE_LINE_9_9
elif (style == "quad"):
self.marker.markerIndex = coin.SoMarkerSet.SQUARE_FILLED_9_9
elif (style == "empty"):
self.marker.markerIndex = coin.SoMarkerSet.SQUARE_LINE_9_9
elif (style == "cross"):
self.marker.markerIndex = coin.SoMarkerSet.CROSS_9_9
else:
self.marker.markerIndex = coin.SoMarkerSet.CIRCLE_FILLED_9_9
self.marker.markerIndex = FreeCADGui.getMarkerIndex(style)
def setCoords(self,point):
self.coords.point.setValue((point.x,point.y,point.z))