quickish fix to prevent board from jumping around when overall size changes

This commit is contained in:
Morgan 'ARR\!' Allen 2025-05-16 18:05:34 -07:00
parent 3a40276260
commit 0e5f275b97

View file

@ -175,7 +175,8 @@ class BoardObject(BaseObject):
Pulls outline from KiCAD PolygonBoard and saves points as Vectors Pulls outline from KiCAD PolygonBoard and saves points as Vectors
''' '''
if self.do_offset: # bit of a quick hack to keep the board in one place, needs more testing
if self.do_offset and not self.feature.BoardOffset:
bb = self.board_polygon.bounding_box() bb = self.board_polygon.bounding_box()
self.feature.BoardOffset.Base = (App.Vector(bb.pos.x, -bb.pos.y) + App.Vector(bb.size.x, -bb.size.y) / 2) / 1000000.0 self.feature.BoardOffset.Base = (App.Vector(bb.pos.x, -bb.pos.y) + App.Vector(bb.size.x, -bb.size.y) / 2) / 1000000.0