diff options
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 20 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 2 |
5 files changed, 16 insertions, 12 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 718156f12a..1480cc6ac4 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1092,8 +1092,6 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag) if (!player->has_animation(player->get_assigned_animation())) return; - Ref<Animation> anim = player->get_animation(player->get_assigned_animation()); - updating = true; frame->set_value(Math::stepify(p_pos, _get_editor_step())); updating = false; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 3dffbf5f9b..d5dc74c134 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -54,7 +54,7 @@ #define MIN_ZOOM 0.01 #define MAX_ZOOM 100 -#define RULER_WIDTH 15 * EDSCALE +#define RULER_WIDTH (15 * EDSCALE) #define SCALE_HANDLE_DISTANCE 25 class SnapDialog : public ConfirmationDialog { @@ -1111,7 +1111,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve if (dragged_guide_index >= 0) { vguides.remove(dragged_guide_index); undo_redo->create_action(TTR("Remove Vertical Guide")); - undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); + if (vguides.empty()) { + undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_"); + } else { + undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); + } undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); @@ -1140,7 +1144,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve if (dragged_guide_index >= 0) { hguides.remove(dragged_guide_index); undo_redo->create_action(TTR("Remove Horizontal Guide")); - undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); + if (hguides.empty()) { + undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_"); + } else { + undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); + } undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); @@ -3202,7 +3210,7 @@ void CanvasItemEditor::_draw_selection() { int next = (i + 1) % 4; Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized(); - ofs *= 1.4144 * (select_handle->get_size().width / 2); + ofs *= Math_SQRT2 * (select_handle->get_size().width / 2); select_handle->draw(ci, (endpoints[i] + ofs - (select_handle->get_size() / 2)).floor()); @@ -4759,13 +4767,13 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (root->has_meta("_edit_horizontal_guides_")) { Array hguides = root->get_meta("_edit_horizontal_guides_"); - undo_redo->add_do_method(root, "set_meta", "_edit_horizontal_guides_", Array()); + undo_redo->add_do_method(root, "remove_meta", "_edit_horizontal_guides_"); undo_redo->add_undo_method(root, "set_meta", "_edit_horizontal_guides_", hguides); } if (root->has_meta("_edit_vertical_guides_")) { Array vguides = root->get_meta("_edit_vertical_guides_"); - undo_redo->add_do_method(root, "set_meta", "_edit_vertical_guides_", Array()); + undo_redo->add_do_method(root, "remove_meta", "_edit_vertical_guides_"); undo_redo->add_undo_method(root, "set_meta", "_edit_vertical_guides_", vguides); } undo_redo->add_undo_method(viewport, "update"); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 34780af59e..a4c3ff5dcd 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -403,7 +403,6 @@ void SpriteFramesEditor::_up_pressed() { sel = to_move; sel -= 1; - Ref<Texture> r = frames->get_frame(edited_anim, to_move); undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move - 1)); undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move - 1, frames->get_frame(edited_anim, to_move)); @@ -428,7 +427,6 @@ void SpriteFramesEditor::_down_pressed() { sel = to_move; sel += 1; - Ref<Texture> r = frames->get_frame(edited_anim, to_move); undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move + 1)); undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move + 1, frames->get_frame(edited_anim, to_move)); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index a2f4040152..8e49bba7b2 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -150,7 +150,7 @@ void TextureRegionEditor::_region_draw() { int next = (i + 1) % 4; Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized(); - ofs *= 1.4144 * (select_handle->get_size().width / 2); + ofs *= Math_SQRT2 * (select_handle->get_size().width / 2); edit_draw->draw_line(endpoints[i] - draw_ofs * draw_zoom, endpoints[next] - draw_ofs * draw_zoom, color, 2); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index a8cf5b46e1..9e873b641b 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2535,7 +2535,7 @@ void TileSetEditor::draw_grid_snap() { if (i == 0 && snap_offset.y != 0) { last_p = snap_offset.y; } - if (snap_separation.x != 0) { + if (snap_separation.y != 0) { if (i != 0) { workspace->draw_rect(Rect2(0, last_p, s.width, snap_separation.y), grid_color); last_p += snap_separation.y; |