Fix Curve point count expansion preserving points

Co-authored-by: Emanuele Denaro <79084923+SeriumTW@users.noreply.github.com>
This commit is contained in:
kobewi
2026-05-27 17:40:07 +02:00
parent c96e11965f
commit c2ef9d3d5b
+3 -1
View File
@@ -53,8 +53,10 @@ void Curve::set_point_count(int p_count) {
_points.resize(p_count);
mark_dirty();
} else {
const real_t default_offset = old_size == 0 ? CLAMP((real_t)0.0, _min_domain, _max_domain) : _max_domain;
const real_t default_value = CLAMP((real_t)0.0, _min_value, _max_value);
for (int i = p_count - old_size; i > 0; i--) {
_add_point(Vector2());
_add_point(Vector2(default_offset, default_value));
}
}
notify_property_list_changed();