Skip to content

Commit daf1517

Browse files
committed
Merge pull request #97753 from jaydensipe/fix-various-editor-easing-property-bugs
Fix various editor easing property issues
2 parents 1ed5f2e + 61179bb commit daf1517

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

editor/inspector/editor_properties.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,6 @@ void EditorPropertyEasing::_drag_easing(const Ref<InputEvent> &p_ev) {
16981698
val = CLAMP(val, -1'000'000, 1'000'000);
16991699

17001700
emit_changed(get_edited_property(), val);
1701-
easing_draw->queue_redraw();
17021701
}
17031702
}
17041703

@@ -1750,14 +1749,16 @@ void EditorPropertyEasing::_draw_easing() {
17501749
}
17511750

17521751
void EditorPropertyEasing::update_property() {
1752+
float val = get_edited_property_value();
1753+
spin->set_value_no_signal(val);
1754+
17531755
easing_draw->queue_redraw();
17541756
}
17551757

17561758
void EditorPropertyEasing::_set_preset(int p_preset) {
17571759
static const float preset_value[EASING_MAX] = { 0.0, 1.0, 2.0, 0.5, -2.0, -0.5 };
17581760

17591761
emit_changed(get_edited_property(), preset_value[p_preset]);
1760-
easing_draw->queue_redraw();
17611762
}
17621763

17631764
void EditorPropertyEasing::_setup_spin() {
@@ -1767,12 +1768,6 @@ void EditorPropertyEasing::_setup_spin() {
17671768
}
17681769

17691770
void EditorPropertyEasing::_spin_value_changed(double p_value) {
1770-
// 0 is a singularity, but both positive and negative values
1771-
// are otherwise allowed. Enforce 0+ as workaround.
1772-
if (Math::is_zero_approx(p_value)) {
1773-
p_value = 0.00001;
1774-
}
1775-
17761771
// Limit to a reasonable value to prevent the curve going into infinity,
17771772
// which can cause crashes and other issues.
17781773
p_value = CLAMP(p_value, -1'000'000, 1'000'000);

0 commit comments

Comments
 (0)