- fixed Paint Tcl command; fixes issue #437

This commit is contained in:
Marius Stanciu
2020-11-10 21:08:00 +02:00
committed by Marius Stanciu
parent ef162bc33a
commit 48c12c2a5c
4 changed files with 28 additions and 20 deletions

View File

@@ -126,8 +126,11 @@ class TclCommandCopperClear(TclCommand):
method_data = 0
elif method == "seed":
method_data = 1
else:
elif method == "lines":
method_data = 2
else:
return "Method not supported or typo.\n" \
"Supported methods are: 'standard', 'seed' and 'lines'."
else:
method = str(self.app.defaults["tools_ncc_method"])
method_data = method
@@ -250,7 +253,7 @@ class TclCommandCopperClear(TclCommand):
ncc_tools[int(tooluid)]['data']['tooldia'] = self.app.dec_format(tool, obj.decimals)
# Non-Copper clear all polygons in the non-copper clear object
if 'all' in args:
if select == 0: # 'all' in args
self.app.ncclear_tool.clear_copper_tcl(ncc_obj=obj,
select_method=0, # ITSELF
ncctooldia=tooldia,
@@ -270,7 +273,7 @@ class TclCommandCopperClear(TclCommand):
return
# Non-Copper clear all polygons found within the box object from the the non_copper cleared object
if 'box' in args: # Reference Object
if select == 2: # Reference Object 'box' in args
box_name = args['box']
# Get box source object.

View File

@@ -105,9 +105,9 @@ class TclCommandPaint(TclCommand):
tooldia = str(self.app.defaults["tools_paint_tooldia"])
if 'overlap' in args:
overlap = float(args['overlap']) / 100.0
overlap = float(args['overlap'])
else:
overlap = float(self.app.defaults["tools_paint_overlap"]) / 100.0
overlap = float(self.app.defaults["tools_paint_overlap"])
if 'order' in args:
order = args['order']
@@ -122,15 +122,18 @@ class TclCommandPaint(TclCommand):
if 'method' in args:
method = args['method']
if method == "standard":
method = _("Standard")
method = 0
elif method == "seed":
method = _("Seed")
method = 1
elif method == "lines":
method = _("Lines")
method = 2
elif method == "laser_lines":
method = _("Laser_lines")
method = 3
elif method == "combo":
method = 4
else:
method = _("Combo")
return "Method not supported or typo.\n" \
"Supported methods are: 'standard', 'seed', 'lines', 'laser_lines' and 'combo'."
else:
method = str(self.app.defaults["tools_paint_method"])
@@ -158,12 +161,12 @@ class TclCommandPaint(TclCommand):
outname = name + "_paint"
# used only to have correct information's in the obj.tools[tool]['data'] dict
if "all" in args:
select = _("All")
elif "single" in args:
select = _("Polygon Selection")
if "single" in args:
select = 1 # _("Polygon Selection")
elif 'box' in args:
select = 3 # _("Reference Object")
else:
select = _("Reference Object")
select = 0 # _("All")
try:
tools = [float(eval(dia)) for dia in tooldia.split(",") if dia != '']
@@ -232,7 +235,7 @@ class TclCommandPaint(TclCommand):
return "Object not found: %s" % name
# Paint all polygons in the painted object
if 'all' in args:
if select == 0: # 'all' in args
self.app.paint_tool.paint_poly_all(obj=obj,
tooldia=tooldia,
order=order,
@@ -244,7 +247,7 @@ class TclCommandPaint(TclCommand):
return
# Paint single polygon in the painted object
if 'single' in args:
if select == 1: # 'single' in args
if not args['single'] or args['single'] == '':
self.raise_tcl_error('%s Got: %s' %
(_("Expected a tuple value like -single 3.2,0.1."), str(args['single'])))
@@ -271,7 +274,7 @@ class TclCommandPaint(TclCommand):
return
# Paint all polygons found within the box object from the the painted object
if 'box' in args:
if select == 3: # 'box' in args
box_name = args['box']
if box_name is None: