diff options
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 51679cca9a..0d6d5f55aa 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1997,15 +1997,14 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { } } + Transform2D edit_transform; + bool using_temp_pivot = !Math::is_inf(temp_pivot.x) || !Math::is_inf(temp_pivot.y); + if (using_temp_pivot) { + edit_transform = Transform2D(drag_selection.front()->get()->_edit_get_rotation(), temp_pivot); + } else { + edit_transform = drag_selection.front()->get()->_edit_get_transform(); + } for (CanvasItem *ci : drag_selection) { - Transform2D edit_transform; - bool using_temp_pivot = !Math::is_inf(temp_pivot.x) || !Math::is_inf(temp_pivot.y); - if (using_temp_pivot) { - edit_transform = Transform2D(ci->_edit_get_rotation(), temp_pivot); - } else { - edit_transform = ci->_edit_get_transform(); - } - Transform2D parent_xform = ci->get_global_transform_with_canvas() * ci->get_transform().affine_inverse(); Transform2D unscaled_transform = (transform * parent_xform * edit_transform).orthonormalized(); Transform2D simple_xform = (viewport->get_transform() * unscaled_transform).affine_inverse() * transform; @@ -3614,7 +3613,7 @@ void CanvasItemEditor::_draw_selection() { // Remove non-movable nodes. for (CanvasItem *ci : selection) { - if (!_is_node_movable(ci, true)) { + if (!_is_node_movable(ci)) { selection.erase(ci); } } @@ -3915,7 +3914,7 @@ void CanvasItemEditor::_draw_message() { Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label")); int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label")); - Point2 msgpos = Point2(RULER_WIDTH + 5 * EDSCALE, viewport->get_size().y - 20 * EDSCALE); + Point2 msgpos = Point2(RULER_WIDTH + 10 * EDSCALE, viewport->get_size().y - 14 * EDSCALE); viewport->draw_string(font, msgpos + Point2(1, 1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); viewport->draw_string(font, msgpos + Point2(-1, -1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); viewport->draw_string(font, msgpos, message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 1)); |