Skip to content

Commit e82870e

Browse files
committed
Merge pull request godotengine#119819 from KoBeWi/fix-curve-set-point-count-preserve-indices-but-without-the-tests
Fix Curve point count expansion preserving points
2 parents 0f551ab + c2ef9d3 commit e82870e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎scene/resources/curve.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ void Curve::set_point_count(int p_count) {
5353
_points.resize(p_count);
5454
mark_dirty();
5555
} else {
56+
const real_t default_offset = old_size == 0 ? CLAMP((real_t)0.0, _min_domain, _max_domain) : _max_domain;
57+
const real_t default_value = CLAMP((real_t)0.0, _min_value, _max_value);
5658
for (int i = p_count - old_size; i > 0; i--) {
57-
_add_point(Vector2());
59+
_add_point(Vector2(default_offset, default_value));
5860
}
5961
}
6062
notify_property_list_changed();

0 commit comments

Comments
 (0)