diff options
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 9b376ae090..c93dc2b340 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -31,6 +31,7 @@ #include "animation_track_editor.h" #include "animation_track_editor_plugins.h" +#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor/animation_bezier_editor.h" #include "editor/plugins/animation_player_editor_plugin.h" @@ -1747,7 +1748,11 @@ void AnimationTimelineEdit::_play_position_draw() { if (px >= get_name_limit() && px < (play_position->get_size().width - get_buttons_width())) { Color color = get_color("accent_color", "Editor"); - play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(EDSCALE)); + play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); + play_position->draw_texture( + get_icon("TimelineIndicator", "EditorIcons"), + Point2(px - get_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0), + color); } } @@ -2437,7 +2442,7 @@ void AnimationTrackEdit::_play_position_draw() { if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { Color color = get_color("accent_color", "Editor"); - play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(EDSCALE)); + play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); } } @@ -3183,7 +3188,7 @@ void AnimationTrackEditGroup::_notification(int p_what) { if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { Color accent = get_color("accent_color", "Editor"); - draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(EDSCALE)); + draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(2 * EDSCALE)); } } } @@ -4082,6 +4087,10 @@ bool AnimationTrackEditor::is_selection_active() const { return selection.size(); } +bool AnimationTrackEditor::is_snap_enabled() const { + return snap->is_pressed() ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); +} + void AnimationTrackEditor::_update_tracks() { int selected = _get_track_selected(); @@ -5045,10 +5054,9 @@ float AnimationTrackEditor::get_moving_selection_offset() const { void AnimationTrackEditor::_box_selection_draw() { - Color color = get_color("accent_color", "Editor"); - color.a = 0.2; - Rect2 rect = Rect2(Point2(), box_selection->get_size()); - box_selection->draw_rect(rect, color); + const Rect2 selection_rect = Rect2(Point2(), box_selection->get_size()); + box_selection->draw_rect(selection_rect, get_color("box_selection_fill_color", "Editor")); + box_selection->draw_rect(selection_rect, get_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); } void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) { @@ -5679,7 +5687,7 @@ void AnimationTrackEditor::_selection_changed() { float AnimationTrackEditor::snap_time(float p_value) { - if (snap->is_pressed()) { + if (is_snap_enabled()) { double snap_increment; if (timeline->is_using_fps() && step->get_value() > 0) @@ -5857,7 +5865,7 @@ AnimationTrackEditor::AnimationTrackEditor() { step = memnew(EditorSpinSlider); step->set_min(0); step->set_max(1000000); - step->set_step(0.01); + step->set_step(0.001); step->set_hide_slider(true); step->set_custom_minimum_size(Size2(100, 0) * EDSCALE); step->set_tooltip(TTR("Animation step value.")); |