summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-17 12:05:42 +0200
committerGitHub <noreply@github.com>2019-08-17 12:05:42 +0200
commit40640a01dc90be00e55e4eef3c7800401ef63b18 (patch)
tree4f1015eb3d42dea4a4dc4e801ec5f8674554d05f
parentfe8f73c939d40ad32a43289fce18322b54b5ef67 (diff)
parenta341c65f65f7171c95b1278621742f8497421f0a (diff)
downloadredot-engine-40640a01dc90be00e55e4eef3c7800401ef63b18.tar.gz
Merge pull request #31424 from Calinou/improve-animation-editor-timeline
Improve timeline drawing in the animation editor
-rw-r--r--editor/animation_track_editor.cpp10
-rw-r--r--editor/icons/icon_timeline_indicator.svg1
2 files changed, 8 insertions, 3 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index bd696d5378..c93dc2b340 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1748,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);
}
}
@@ -2438,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));
}
}
@@ -3184,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));
}
}
}
diff --git a/editor/icons/icon_timeline_indicator.svg b/editor/icons/icon_timeline_indicator.svg
new file mode 100644
index 0000000000..fd18192705
--- /dev/null
+++ b/editor/icons/icon_timeline_indicator.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 0h10l-4 4h-2z" fill="#fefefe"/></svg> \ No newline at end of file