diff options
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 13 | ||||
-rw-r--r-- | editor/plugins/material_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 11 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 1 |
9 files changed, 14 insertions, 27 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d4eab888cc..19199f37ef 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1061,9 +1061,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> b = p_event; if (b.is_valid()) { + bool pan_on_scroll = bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan")) && !b->get_control(); + if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_DOWN) { // Scroll or pan down - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.y += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); } else { @@ -1074,7 +1076,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_UP) { // Scroll or pan up - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.y -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); } else { @@ -1085,7 +1087,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_LEFT) { // Pan left - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.x -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); return true; @@ -1094,7 +1096,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_RIGHT) { // Pan right - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.x += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); return true; @@ -1104,6 +1106,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (!panning) { if (b->is_pressed() && (b->get_button_index() == BUTTON_MIDDLE || + b->get_button_index() == BUTTON_RIGHT || (b->get_button_index() == BUTTON_LEFT && tool == TOOL_PAN) || (b->get_button_index() == BUTTON_LEFT && !EditorSettings::get_singleton()->get("editors/2d/simple_panning") && pan_pressed))) { // Pan the viewport @@ -1431,7 +1434,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { for (int i = 0; i < 4; i++) { anchor_pos[i] = (transform * control->get_global_transform_with_canvas()).xform(_anchor_to_position(control, anchor_pos[i])); anchor_rects[i] = Rect2(anchor_pos[i], anchor_handle->get_size()); - anchor_rects[i].position -= anchor_handle->get_size() * Vector2(i == 0 || i == 3, i <= 1); + anchor_rects[i].position -= anchor_handle->get_size() * Vector2(float(i == 0 || i == 3), float(i <= 1)); } DragType dragger[] = { diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index ebacccb03c..e125c18ef1 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -34,9 +34,6 @@ void MaterialEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 6203035e25..442110cc84 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -48,9 +48,6 @@ void MeshEditor::_gui_input(Ref<InputEvent> p_event) { void MeshEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index b8d95efd49..620bf28415 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -39,9 +39,6 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) { void ResourcePreloaderEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_ENTER_TREE) { load->set_icon(get_icon("Folder", "EditorIcons")); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 0aa4a7662c..6d71c56ead 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -39,9 +39,6 @@ void TextureEditor::_gui_input(Ref<InputEvent> p_event) { void TextureEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index cb48b5eaa5..4d349f06b7 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -193,7 +193,7 @@ void TextureRegionEditor::_region_draw() { updating_scroll = false; if (node_ninepatch || obj_styleBox.is_valid()) { - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -204,12 +204,8 @@ void TextureRegionEditor::_region_draw() { margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM); margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); - } else { - margins[0] = 0; - margins[1] = 0; - margins[2] = 0; - margins[3] = 0; } + Vector2 pos[4] = { mtx.basis_xform(Vector2(0, margins[0])) + Vector2(0, endpoints[0].y - draw_ofs.y * draw_zoom), -mtx.basis_xform(Vector2(0, margins[1])) + Vector2(0, endpoints[2].y - draw_ofs.y * draw_zoom), @@ -248,7 +244,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (mb->is_pressed()) { if (node_ninepatch || obj_styleBox.is_valid()) { edited_margin = -1; - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -260,6 +256,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); } + Vector2 pos[4] = { mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs * draw_zoom, mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs * draw_zoom, diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 5e87016171..f135becf5f 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -3369,7 +3369,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const void TilesetEditorContext::_bind_methods() { - ClassDB::bind_method("_hide_object_properties_from_inspector", &TilesetEditorContext::_hide_object_properties_from_inspector); + ClassDB::bind_method("_hide_script_from_inspector", &TilesetEditorContext::_hide_script_from_inspector); } TilesetEditorContext::TilesetEditorContext(TileSetEditor *p_tileset_editor) { diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 946c042b02..69ad8205a4 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -252,7 +252,7 @@ class TilesetEditorContext : public Object { bool snap_options_visible; public: - bool _hide_object_properties_from_inspector() { return true; } + bool _hide_script_from_inspector() { return true; } void set_tileset(const Ref<TileSet> &p_tileset); private: diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index aaa99996e6..28719d9e3e 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1513,7 +1513,6 @@ void VisualShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) _update_graph(); - } else if (p_what == NOTIFICATION_PROCESS) { } } |