1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-30 18:30:54 +00:00

Make remote debug elements ignore the canvas scaling

This commit is contained in:
Michael Alexsander
2025-10-15 21:05:15 -03:00
parent f5918a9d35
commit 33c2ce5dee
2 changed files with 9 additions and 1 deletions

View File

@@ -30,6 +30,7 @@
#include "scene_debugger.h"
#include "core/config/project_settings.h"
#include "core/debugger/debugger_marshalls.h"
#include "core/debugger/engine_debugger.h"
#include "core/io/dir_access.h"
@@ -1560,6 +1561,7 @@ void RuntimeNodeSelect::_setup(const Dictionary &p_settings) {
panner->set_scroll_speed(pan_speed);
sel_2d_grab_dist = p_settings.get("editors/polygon_editor/point_grab_radius", 0);
sel_2d_scale = MAX(1, Math::ceil(2.0 / (float)GLOBAL_GET("display/window/stretch/scale")));
selection_area_fill = p_settings.get("box_selection_fill_color", Color());
selection_area_outline = p_settings.get("box_selection_stroke_color", Color());
@@ -2195,7 +2197,7 @@ void RuntimeNodeSelect::_update_selection() {
const Color selection_color_2d = Color(1, 0.6, 0.4, 0.7);
for (int i = 0; i < 4; i++) {
RS::get_singleton()->canvas_item_add_line(sbox_2d_ci, endpoints[i], endpoints[(i + 1) % 4], selection_color_2d, 2);
RS::get_singleton()->canvas_item_add_line(sbox_2d_ci, endpoints[i], endpoints[(i + 1) % 4], selection_color_2d, sel_2d_scale);
}
}
@@ -2337,6 +2339,11 @@ void RuntimeNodeSelect::_open_selection_list(const Vector<SelectResult> &p_items
selection_list->set_position(selection_list->is_embedded() ? p_pos : (Input::get_singleton()->get_mouse_position() + root->get_position()));
selection_list->reset_size();
selection_list->popup();
selection_list->set_content_scale_factor(1);
selection_list->set_min_size(selection_list->get_contents_minimum_size());
selection_list->reset_size();
// FIXME: Ugly hack that stops the popup from hiding when the button is released.
selection_list->call_deferred(SNAME("set_position"), selection_list->get_position() + Point2(1, 0));
}

View File

@@ -299,6 +299,7 @@ private:
LocalVector<ObjectID> selected_ci_nodes;
real_t sel_2d_grab_dist = 0;
int sel_2d_scale = 1;
RID sbox_2d_ci;