Skip to content

Commit 27b795c

Browse files
committed
Fix crash when resetting scale
1 parent 91434a0 commit 27b795c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

math/transform_nd.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,9 @@ VectorN TransformND::get_scale_abs() const {
637637
}
638638

639639
void TransformND::set_scale_abs(const VectorN &p_scale) {
640-
const int column_count = _columns.size();
641-
for (int i = 0; i < column_count; i++) {
642-
const double scale = p_scale[i];
640+
const int64_t column_count = _columns.size();
641+
for (int64_t i = 0; i < column_count; i++) {
642+
const double scale = i < p_scale.size() ? p_scale[i] : 1.0;
643643
_columns.set(i, VectorND::with_length(_columns[i], scale));
644644
}
645645
}

0 commit comments

Comments
 (0)