summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-10-02 14:39:12 +0700
committerPoommetee Ketson <poommetee@protonmail.com>2017-10-03 03:48:11 +0700
commit0ce4d82bbfde8fba8e22e07635817fc649214c1e (patch)
tree77eb4e9bc03654438df7affa2c3a2d67686223a5 /editor
parent2fbffb7cde4c29f56dcfeeb04a7ec2be23e3ab96 (diff)
CurveEditor: fix can't edit right tangent
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/curve_editor_plugin.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp
index 067629c460..2754aeed06 100644
--- a/editor/plugins/curve_editor_plugin.cpp
+++ b/editor/plugins/curve_editor_plugin.cpp
@@ -53,12 +53,12 @@ CurveEditor::CurveEditor() {
_presets_menu = memnew(PopupMenu);
_presets_menu->set_name("_presets_menu");
- _presets_menu->add_item("Flat0", PRESET_FLAT0);
- _presets_menu->add_item("Flat1", PRESET_FLAT1);
- _presets_menu->add_item("Linear", PRESET_LINEAR);
- _presets_menu->add_item("Ease in", PRESET_EASE_IN);
- _presets_menu->add_item("Ease out", PRESET_EASE_OUT);
- _presets_menu->add_item("Smoothstep", PRESET_SMOOTHSTEP);
+ _presets_menu->add_item(TTR("Flat0"), PRESET_FLAT0);
+ _presets_menu->add_item(TTR("Flat1"), PRESET_FLAT1);
+ _presets_menu->add_item(TTR("Linear"), PRESET_LINEAR);
+ _presets_menu->add_item(TTR("Ease in"), PRESET_EASE_IN);
+ _presets_menu->add_item(TTR("Ease out"), PRESET_EASE_OUT);
+ _presets_menu->add_item(TTR("Smoothstep"), PRESET_SMOOTHSTEP);
_presets_menu->connect("id_pressed", this, "_on_preset_item_selected");
_context_menu->add_child(_presets_menu);
}
@@ -344,19 +344,19 @@ void CurveEditor::open_context_menu(Vector2 pos) {
_curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR :
_curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
- _context_menu->set_item_checked(CONTEXT_LINEAR, is_linear);
+ _context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LINEAR), is_linear);
} else {
_context_menu->add_separator();
if (_selected_point > 0) {
_context_menu->add_check_item(TTR("Left linear"), CONTEXT_LEFT_LINEAR);
- _context_menu->set_item_checked(CONTEXT_LEFT_LINEAR,
+ _context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LEFT_LINEAR),
_curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR);
}
if (_selected_point + 1 < _curve_ref->get_point_count()) {
_context_menu->add_check_item(TTR("Right linear"), CONTEXT_RIGHT_LINEAR);
- _context_menu->set_item_checked(CONTEXT_RIGHT_LINEAR,
+ _context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_RIGHT_LINEAR),
_curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR);
}
}