diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 22:24:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 22:24:58 +0100 |
commit | 8107fc98b6ceae749b3c10e6f0432e904961867b (patch) | |
tree | 6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /editor/animation_track_editor_plugins.cpp | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) | |
parent | 8d51618949d5ea8a94e0f504401e8f852a393968 (diff) |
Merge pull request #25853 from marxin/fix-25316-wshadow-local
Add -Wshadow=local to warnings and fix reported issues (#25316).
Diffstat (limited to 'editor/animation_track_editor_plugins.cpp')
-rw-r--r-- | editor/animation_track_editor_plugins.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 8c2c2b7f38..bb0bd1b458 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "animation_track_editor_plugins.h" + #include "editor/audio_stream_preview.h" #include "editor_resource_preview.h" #include "editor_scale.h" @@ -37,6 +38,7 @@ #include "scene/3d/sprite_3d.h" #include "scene/animation/animation_player.h" #include "servers/audio/audio_stream.h" + /// BOOL /// int AnimationTrackEditBool::get_key_height() const { @@ -247,9 +249,6 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, return; } - Ref<Font> font = get_font("font", "Label"); - float fh = int(font->get_height() * 1.5); - bool play = get_animation()->track_get_key_value(get_track(), p_index); if (play) { float len = stream->get_length(); @@ -285,8 +284,9 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, if (to_x <= from_x) return; - int h = get_size().height; - Rect2 rect = Rect2(from_x, (h - fh) / 2, to_x - from_x, fh); + Ref<Font> font = get_font("font", "Label"); + float fh = int(font->get_height() * 1.5); + Rect2 rect = Rect2(from_x, (get_size().height - fh) / 2, to_x - from_x, fh); draw_rect(rect, Color(0.25, 0.25, 0.25)); Vector<Vector2> lines; @@ -439,13 +439,13 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in return; } - int frame = get_animation()->track_get_key_value(get_track(), p_index); - Ref<Texture> texture; Rect2 region; if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { + int frame = get_animation()->track_get_key_value(get_track(), p_index); + texture = object->call("get_texture"); if (!texture.is_valid()) { AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right); |