- made sure that the Offset fields in the Properties Tab are updated on object: move, origin change, transformations

This commit is contained in:
Marius Stanciu
2021-01-22 15:07:41 +02:00
committed by Marius
parent 92eee438a2
commit 5b0ec590f3
7 changed files with 105 additions and 11 deletions

View File

@@ -195,10 +195,13 @@ class GerberObject(FlatCAMObj, Gerber):
self.build_ui()
self.units_found = self.app.defaults['units']
self.set_offset_values()
def set_offset_values(self):
xmin, ymin, xmax, ymax = self.bounds()
center_coords = (
xmin + abs((xmax - xmin) / 2),
ymin + abs((ymax - ymin) / 2)
self.app.dec_format((xmin + abs((xmax - xmin) / 2)), self.decimals),
self.app.dec_format((ymin + abs((ymax - ymin) / 2)), self.decimals)
)
self.ui.offsetvector_entry.set_value(str(center_coords))