From 86afcd0e7ec7ffd906209eae0adf4ba7671f4868 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Wed, 11 Apr 2018 14:28:37 +0800 Subject: [PATCH] Fix boundingbox --- src/meshgenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meshgenerator.cpp b/src/meshgenerator.cpp index e47bef76..ee12b944 100644 --- a/src/meshgenerator.cpp +++ b/src/meshgenerator.cpp @@ -102,11 +102,11 @@ void MeshGenerator::resolveBoundingBox(QRectF *mainProfile, QRectF *sideProfile) top = y - radius; topFirstTime = false; } - if (rightFirstTime > right) { + if (rightFirstTime || x + radius > right) { right = x + radius; rightFirstTime = false; } - if (bottomFirstTime > bottom) { + if (bottomFirstTime || y + radius > bottom) { bottom = y + radius; bottomFirstTime = false; } @@ -114,7 +114,7 @@ void MeshGenerator::resolveBoundingBox(QRectF *mainProfile, QRectF *sideProfile) zLeft = z - radius; zLeftFirstTime = false; } - if (zRightFirstTime > zRight) { + if (zRightFirstTime || z + radius > zRight) { zRight = z + radius; zRightFirstTime = false; }