From a8865f3402544808e0d89faa661b463058960bbd Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sun, 6 Nov 2022 10:22:05 +0100 Subject: Fix: Missing initialization curves bounds in set origin operator It could be changed, but currently curves.bounds_min_max relies on the initial value of its arguments. Split from D16331. --- source/blender/editors/object/object_transform.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object/object_transform.cc') diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index 0c2aca8b97b..7d0b62db827 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -7,6 +7,7 @@ #include #include +#include #include #include "DNA_anim_types.h" @@ -1643,8 +1644,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) /* done */ } else if (around == V3D_AROUND_CENTER_BOUNDS) { - float3 min; - float3 max; + float3 min(std::numeric_limits::max()); + float3 max(-std::numeric_limits::max()); if (curves.bounds_min_max(min, max)) { cent = math::midpoint(min, max); } -- cgit v1.2.3