- for Excellon, Geometry and Gerber objects now in the Object UI (Properties Tab) by default the Offset field is populated with the coordinates of the center of the current object
This commit is contained in:
@@ -187,6 +187,13 @@ class ExcellonObject(FlatCAMObj, Excellon):
|
||||
|
||||
self.units_found = self.app.defaults['units']
|
||||
|
||||
xmin, ymin, xmax, ymax = self.bounds()
|
||||
center_coords = (
|
||||
xmin + abs((xmax - xmin) / 2),
|
||||
ymin + abs((ymax - ymin) / 2)
|
||||
)
|
||||
self.ui.offsetvector_entry.set_value(str(center_coords))
|
||||
|
||||
def change_level(self, level):
|
||||
"""
|
||||
|
||||
|
||||
@@ -701,6 +701,13 @@ class GeometryObject(FlatCAMObj, Geometry):
|
||||
#
|
||||
# self.launch_job.connect(self.mtool_gen_cncjob)
|
||||
|
||||
xmin, ymin, xmax, ymax = self.bounds()
|
||||
center_coords = (
|
||||
xmin + abs((xmax - xmin) / 2),
|
||||
ymin + abs((ymax - ymin) / 2)
|
||||
)
|
||||
self.ui.offsetvector_entry.set_value(str(center_coords))
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
@@ -195,6 +195,13 @@ class GerberObject(FlatCAMObj, Gerber):
|
||||
self.build_ui()
|
||||
self.units_found = self.app.defaults['units']
|
||||
|
||||
xmin, ymin, xmax, ymax = self.bounds()
|
||||
center_coords = (
|
||||
xmin + abs((xmax - xmin) / 2),
|
||||
ymin + abs((ymax - ymin) / 2)
|
||||
)
|
||||
self.ui.offsetvector_entry.set_value(str(center_coords))
|
||||
|
||||
def change_level(self, level):
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user