diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 7 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 4 |
3 files changed, 15 insertions, 8 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c5b67eb971..dd15910d09 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1765,6 +1765,8 @@ void EditorNode::_edit_current() { return; } + Object *prev_inspected_object = get_inspector()->get_edited_object(); + bool capitalize = bool(EDITOR_GET("interface/inspector/capitalize_properties")); bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding")); bool is_resource = current_obj->is_class("Resource"); @@ -1856,6 +1858,11 @@ void EditorNode::_edit_current() { inspector_dock->update(NULL); } + if (current_obj == prev_inspected_object) { + // Make sure inspected properties are restored. + get_inspector()->update_tree(); + } + inspector_dock->set_warning(editable_warning); if (get_inspector()->is_capitalize_paths_enabled() != capitalize) { diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index a418915830..2f9135c52c 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -2634,22 +2634,22 @@ template <> struct EditorSceneImporterGLTFInterpolate<Quat> { Quat lerp(const Quat &a, const Quat &b, const float c) const { - ERR_FAIL_COND_V(!a.is_normalized(), Quat()); - ERR_FAIL_COND_V(!b.is_normalized(), Quat()); + ERR_FAIL_COND_V_MSG(!a.is_normalized(), Quat(), "The quaternion \"a\" must be normalized."); + ERR_FAIL_COND_V_MSG(!b.is_normalized(), Quat(), "The quaternion \"b\" must be normalized."); return a.slerp(b, c).normalized(); } Quat catmull_rom(const Quat &p0, const Quat &p1, const Quat &p2, const Quat &p3, const float c) { - ERR_FAIL_COND_V(!p1.is_normalized(), Quat()); - ERR_FAIL_COND_V(!p2.is_normalized(), Quat()); + ERR_FAIL_COND_V_MSG(!p1.is_normalized(), Quat(), "The quaternion \"p1\" must be normalized."); + ERR_FAIL_COND_V_MSG(!p2.is_normalized(), Quat(), "The quaternion \"p2\" must be normalized."); return p1.slerp(p2, c).normalized(); } Quat bezier(const Quat start, const Quat control_1, const Quat control_2, const Quat end, const float t) { - ERR_FAIL_COND_V(!start.is_normalized(), Quat()); - ERR_FAIL_COND_V(!end.is_normalized(), Quat()); + ERR_FAIL_COND_V_MSG(!start.is_normalized(), Quat(), "The start quaternion must be normalized."); + ERR_FAIL_COND_V_MSG(!end.is_normalized(), Quat(), "The end quaternion must be normalized."); return start.slerp(end, t).normalized(); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d3cbf2947e..1d8f3a2bbd 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2599,14 +2599,14 @@ void CanvasItemEditor::_draw_guides() { Color text_color = get_color("font_color", "Editor"); text_color.a = 0.5; if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) { - String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).x); + String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x)); Ref<Font> font = get_font("font", "Label"); Size2 text_size = font->get_string_size(str); viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, text_color); viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE)); } if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) { - String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).y); + String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y)); Ref<Font> font = get_font("font", "Label"); Size2 text_size = font->get_string_size(str); viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, text_color); |