From 92cf46773a318d605f6a28a86e3eeb298faf6d00 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 28 Jun 2021 14:55:15 +0200 Subject: [PATCH] Hotfix for arrange not working for objects with huge translation. --- src/libnest2d/include/libnest2d/geometry_traits.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libnest2d/include/libnest2d/geometry_traits.hpp b/src/libnest2d/include/libnest2d/geometry_traits.hpp index 7ea4373398..f388e37b11 100644 --- a/src/libnest2d/include/libnest2d/geometry_traits.hpp +++ b/src/libnest2d/include/libnest2d/geometry_traits.hpp @@ -501,8 +501,9 @@ inline P _Box

::center() const BP2D_NOEXCEPT { using Coord = TCoord

; P ret = { // No rounding here, we dont know if these are int coords - Coord( (getX(minc) + getX(maxc)) / Coord(2) ), - Coord( (getY(minc) + getY(maxc)) / Coord(2) ) + // Doing the division like this increases the max range of x and y coord + getX(minc) / Coord(2) + getX(maxc) / Coord(2), + getY(minc) / Coord(2) + getY(maxc) / Coord(2) }; return ret;