1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Fixed issue where some of the animation editor buttons were difficult to click, mainly the add key button. This was due to an error in the offsets

This commit is contained in:
BenH
2017-11-18 15:23:22 +00:00
parent 63283eca55
commit 090a9abf84

View File

@@ -1368,7 +1368,7 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x-=hsep; icon_ofs.x-=hsep;
*/ */
track_ofs[0] = size.width - icon_ofs.x; track_ofs[0] = size.width - icon_ofs.x + ofs.x;
icon_ofs.x -= down_icon->get_width(); icon_ofs.x -= down_icon->get_width();
te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE)); te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));
@@ -1380,7 +1380,7 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x -= hsep; icon_ofs.x -= hsep;
te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor); te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor);
track_ofs[1] = size.width - icon_ofs.x; track_ofs[1] = size.width - icon_ofs.x + ofs.x;
icon_ofs.x -= down_icon->get_width(); icon_ofs.x -= down_icon->get_width();
te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE)); te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));
@@ -1394,7 +1394,7 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x -= hsep; icon_ofs.x -= hsep;
te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor); te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor);
track_ofs[2] = size.width - icon_ofs.x; track_ofs[2] = size.width - icon_ofs.x + ofs.x;
if (animation->track_get_type(idx) == Animation::TYPE_VALUE) { if (animation->track_get_type(idx) == Animation::TYPE_VALUE) {
@@ -1415,13 +1415,12 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x -= hsep; icon_ofs.x -= hsep;
te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor); te->draw_line(Point2(icon_ofs.x, ofs.y + y), Point2(icon_ofs.x, ofs.y + y + h), sepcolor);
track_ofs[3] = size.width - icon_ofs.x; track_ofs[3] = size.width - icon_ofs.x + ofs.x;
icon_ofs.x -= hsep; icon_ofs.x -= hsep;
icon_ofs.x -= add_key_icon->get_width(); icon_ofs.x -= add_key_icon->get_width();
te->draw_texture((mouse_over.over == MouseOver::OVER_ADD_KEY && mouse_over.track == idx) ? add_key_icon_hl : add_key_icon, icon_ofs); te->draw_texture((mouse_over.over == MouseOver::OVER_ADD_KEY && mouse_over.track == idx) ? add_key_icon_hl : add_key_icon, icon_ofs);
track_ofs[4] = size.width - icon_ofs.x + ofs.x;
track_ofs[4] = size.width - icon_ofs.x;
//draw the keys; //draw the keys;
int tt = animation->track_get_type(idx); int tt = animation->track_get_type(idx);