You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-04 19:21:46 +00:00
Fix select and edit invisble items in SubViewports
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "scene/2d/physics/ray_cast_2d.h"
|
||||
#include "scene/2d/physics/shape_cast_2d.h"
|
||||
#include "scene/main/viewport.h"
|
||||
|
||||
void Cast2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
@@ -59,6 +60,11 @@ bool Cast2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Viewport *vp = node->get_viewport();
|
||||
if (vp && !vp->is_visible_subviewport()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_screen_transform();
|
||||
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
@@ -114,6 +120,11 @@ void Cast2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
|
||||
return;
|
||||
}
|
||||
|
||||
Viewport *vp = node->get_viewport();
|
||||
if (vp && !vp->is_visible_subviewport()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_screen_transform();
|
||||
|
||||
const Ref<Texture2D> handle = get_editor_theme_icon(SNAME("EditorHandle"));
|
||||
|
||||
Reference in New Issue
Block a user