src/types/boundingbox.cpp

changeset 23
3387a84ddaba
parent 22
6da867fa5429
child 33
4c41bfe2ec6e
--- a/src/types/boundingbox.cpp	Sun Jan 19 02:54:48 2020 +0200
+++ b/src/types/boundingbox.cpp	Sun Jan 19 13:53:07 2020 +0200
@@ -41,11 +41,11 @@
 {
 	if (box != emptyBoundingBox)
 	{
-		double dx = box.minimum.x - box.maximum.x;
-		double dy = box.minimum.y - box.maximum.y;
-		double dz = box.minimum.z - box.maximum.z;
-		double size = std::max(std::max(dx, dy), dz);
-		return std::max(std::abs(size / 2.0), 1.0);
+		const double dx = std::abs(box.minimum.x - box.maximum.x);
+		const double dy = std::abs(box.minimum.y - box.maximum.y);
+		const double dz = std::abs(box.minimum.z - box.maximum.z);
+		const double size = std::max(std::max(dx, dy), dz);
+		return std::max(size / 2.0, 1.0);
 	}
 	else
 	{

mercurial