Fix #115108: Object dimensions infinite for armatures

The initialization of min and max was reversed. Switch to C++
numeric limits, which I'm a bit more used to ad this point.
This commit is contained in:
Hans Goudey
2023-11-30 23:40:34 -05:00
parent 8c8ea2ec47
commit 91c936e01c

View File

@@ -12,6 +12,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <limits>
#include "MEM_guardedalloc.h"
@@ -2919,8 +2920,8 @@ std::optional<blender::Bounds<blender::float3>> BKE_armature_min_max(const bPose
if (BLI_listbase_is_empty(&pose->chanbase)) {
return std::nullopt;
}
blender::float3 min(-FLT_MAX);
blender::float3 max(FLT_MAX);
blender::float3 min(std::numeric_limits<float>::max());
blender::float3 max(std::numeric_limits<float>::lowest());
/* For now, we assume BKE_pose_where_is has already been called
* (hence we have valid data in pachan). */
LISTBASE_FOREACH (bPoseChannel *, pchan, &pose->chanbase) {