Merge pull request #63755 from raulsntos/fix-vector4-min-axis-index

Fix `Vector4::min_axis_index` for equal components
This commit is contained in:
Rémi Verschelde 2022-08-01 07:48:43 +02:00 committed by GitHub
commit 12dc5619e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ Vector4::Axis Vector4::min_axis_index() const {
uint32_t min_index = 0;
real_t min_value = x;
for (uint32_t i = 1; i < 4; i++) {
if (operator[](i) < min_value) {
if (operator[](i) <= min_value) {
min_index = i;
min_value = operator[](i);
}

View File

@ -47,7 +47,7 @@ Vector4i::Axis Vector4i::min_axis_index() const {
uint32_t min_index = 0;
int32_t min_value = x;
for (uint32_t i = 1; i < 4; i++) {
if (operator[](i) < min_value) {
if (operator[](i) <= min_value) {
min_index = i;
min_value = operator[](i);
}