You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix wrong canvas camera override panning in the runtime debugger
This commit is contained in:
@@ -1425,7 +1425,7 @@ void RuntimeNodeSelect::_root_window_input(const Ref<InputEvent> &p_event) {
|
|||||||
bool is_dragging_camera = false;
|
bool is_dragging_camera = false;
|
||||||
if (camera_override) {
|
if (camera_override) {
|
||||||
if (node_select_type == NODE_TYPE_2D) {
|
if (node_select_type == NODE_TYPE_2D) {
|
||||||
is_dragging_camera = panner->gui_input(p_event, Rect2(Vector2(), root->get_size()));
|
is_dragging_camera = panner->gui_input(p_event, Rect2(Vector2(), root->get_visible_rect().get_size()));
|
||||||
} else if (node_select_type == NODE_TYPE_3D && selection_drag_state == SELECTION_DRAG_NONE) {
|
} else if (node_select_type == NODE_TYPE_3D && selection_drag_state == SELECTION_DRAG_NONE) {
|
||||||
#ifndef _3D_DISABLED
|
#ifndef _3D_DISABLED
|
||||||
if (_handle_3d_input(p_event)) {
|
if (_handle_3d_input(p_event)) {
|
||||||
@@ -2214,8 +2214,9 @@ void RuntimeNodeSelect::_find_canvas_items_at_rect(const Rect2 &p_rect, Node *p_
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RuntimeNodeSelect::_pan_callback(Vector2 p_scroll_vec, Ref<InputEvent> p_event) {
|
void RuntimeNodeSelect::_pan_callback(Vector2 p_scroll_vec, Ref<InputEvent> p_event) {
|
||||||
view_2d_offset.x -= p_scroll_vec.x / view_2d_zoom;
|
Vector2 scroll = SceneTree::get_singleton()->get_root()->get_screen_transform().affine_inverse().xform(p_scroll_vec);
|
||||||
view_2d_offset.y -= p_scroll_vec.y / view_2d_zoom;
|
view_2d_offset.x -= scroll.x / view_2d_zoom;
|
||||||
|
view_2d_offset.y -= scroll.y / view_2d_zoom;
|
||||||
|
|
||||||
_update_view_2d();
|
_update_view_2d();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user