mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 15:45:56 +08:00
objects placed with an offset to the grid
Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com> CURA-7951
This commit is contained in:
parent
2089462cd8
commit
7449e2137c
@ -97,8 +97,8 @@ class GridArrange:
|
|||||||
|
|
||||||
def moveNodeOnGrid(self, node: "SceneNode", grid_x: int, grid_y: int) -> "Operation.Operation":
|
def moveNodeOnGrid(self, node: "SceneNode", grid_x: int, grid_y: int) -> "Operation.Operation":
|
||||||
coord_grid_x, coord_grid_y = self.gridSpaceToCoordSpace(grid_x, grid_y)
|
coord_grid_x, coord_grid_y = self.gridSpaceToCoordSpace(grid_x, grid_y)
|
||||||
center_grid_x = coord_grid_x + (0.5 * self._grid_width)
|
center_grid_x = coord_grid_x + (0.5 * (self._grid_width + self.offset_x))
|
||||||
center_grid_y = coord_grid_y + (0.5 * self._grid_height)
|
center_grid_y = coord_grid_y + (0.5 * (self._grid_height + self.offset_y))
|
||||||
|
|
||||||
bounding_box = node.getBoundingBox()
|
bounding_box = node.getBoundingBox()
|
||||||
center_node_x = (bounding_box.left + bounding_box.right) * 0.5
|
center_node_x = (bounding_box.left + bounding_box.right) * 0.5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user