- application wide change: introduced the precision parameters in Edit -> Preferences who will control how many decimals to use in the app parameters

This commit is contained in:
Marius Stanciu
2019-12-05 15:18:54 +02:00
parent 19b5f732b5
commit 0d0f872244
53 changed files with 481 additions and 445 deletions

View File

@@ -89,6 +89,14 @@ class TclCommandPaint(TclCommand):
name = args['name']
# Get source object.
try:
obj = self.app.collection.get_by_name(str(name))
except Exception as e:
log.debug("TclCommandPaint.execute() --> %s" % str(e))
self.raise_tcl_error("%s: %s" % (_("Could not retrieve object"), name))
return "Could not retrieve object: %s" % name
if 'tooldia' in args:
tooldia = str(args['tooldia'])
else:
@@ -129,14 +137,6 @@ class TclCommandPaint(TclCommand):
else:
outname = name + "_paint"
# Get source object.
try:
obj = self.app.collection.get_by_name(str(name))
except Exception as e:
log.debug("TclCommandPaint.execute() --> %s" % str(e))
self.raise_tcl_error("%s: %s" % (_("Could not retrieve object"), name))
return "Could not retrieve object: %s" % name
try:
tools = [float(eval(dia)) for dia in tooldia.split(",") if dia != '']
except AttributeError:
@@ -181,7 +181,7 @@ class TclCommandPaint(TclCommand):
tooluid += 1
paint_tools.update({
int(tooluid): {
'tooldia': float('%.4f' % tool),
'tooldia': float('%.*f' % (obj.decimals, tool)),
'offset': 'Path',
'offset_value': 0.0,
'type': 'Iso',