Merge pull request #97753 from jaydensipe/fix-various-editor-easing-property-bugs
Fix various editor easing property issues
This commit is contained in:
commit
daf15172eb
1 changed files with 3 additions and 8 deletions
|
|
@ -1698,7 +1698,6 @@ void EditorPropertyEasing::_drag_easing(const Ref<InputEvent> &p_ev) {
|
|||
val = CLAMP(val, -1'000'000, 1'000'000);
|
||||
|
||||
emit_changed(get_edited_property(), val);
|
||||
easing_draw->queue_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1750,6 +1749,9 @@ void EditorPropertyEasing::_draw_easing() {
|
|||
}
|
||||
|
||||
void EditorPropertyEasing::update_property() {
|
||||
float val = get_edited_property_value();
|
||||
spin->set_value_no_signal(val);
|
||||
|
||||
easing_draw->queue_redraw();
|
||||
}
|
||||
|
||||
|
|
@ -1757,7 +1759,6 @@ void EditorPropertyEasing::_set_preset(int p_preset) {
|
|||
static const float preset_value[EASING_MAX] = { 0.0, 1.0, 2.0, 0.5, -2.0, -0.5 };
|
||||
|
||||
emit_changed(get_edited_property(), preset_value[p_preset]);
|
||||
easing_draw->queue_redraw();
|
||||
}
|
||||
|
||||
void EditorPropertyEasing::_setup_spin() {
|
||||
|
|
@ -1767,12 +1768,6 @@ void EditorPropertyEasing::_setup_spin() {
|
|||
}
|
||||
|
||||
void EditorPropertyEasing::_spin_value_changed(double p_value) {
|
||||
// 0 is a singularity, but both positive and negative values
|
||||
// are otherwise allowed. Enforce 0+ as workaround.
|
||||
if (Math::is_zero_approx(p_value)) {
|
||||
p_value = 0.00001;
|
||||
}
|
||||
|
||||
// Limit to a reasonable value to prevent the curve going into infinity,
|
||||
// which can cause crashes and other issues.
|
||||
p_value = CLAMP(p_value, -1'000'000, 1'000'000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue