diff options
author | Hans Goudey <h.goudey@me.com> | 2022-11-06 12:22:05 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-11-06 12:23:14 +0300 |
commit | a8865f3402544808e0d89faa661b463058960bbd (patch) | |
tree | 3aa4fb16f135508435120b854e0d92429ed40dba /source/blender/editors/object/object_transform.cc | |
parent | 3852094b35ea659094ab30ffca9e2fe086b1a368 (diff) |
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.
Diffstat (limited to 'source/blender/editors/object/object_transform.cc')
-rw-r--r-- | source/blender/editors/object/object_transform.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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 <cstdlib> #include <cstring> +#include <limits> #include <numeric> #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<float>::max()); + float3 max(-std::numeric_limits<float>::max()); if (curves.bounds_min_max(min, max)) { cent = math::midpoint(min, max); } |