From c1d13df0ef46cb543fdb5162f11af5c4ed9de3c4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 10 Sep 2021 22:10:43 +0200 Subject: [PATCH] Enable Pixel Snap by default in the 2D editor Since this avoids accidentally placing 2D nodes at subpixel positions, this results in more crisp visuals by default, even when pixel snapping is disabled in the project settings. (cherry picked from commit c03e7c2dde10c0981ae9db39e4e6a7a40838b3db) --- editor/plugins/canvas_item_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 5946a568195..5f82e22b254 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5716,7 +5716,9 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_rotation = false; snap_scale = false; snap_relative = false; - snap_pixel = false; + // Enable pixel snapping even if pixel snap rendering is disabled in the Project Settings. + // This results in crisper visuals by preventing 2D nodes from being placed at subpixel coordinates. + snap_pixel = true; snap_target[0] = SNAP_TARGET_NONE; snap_target[1] = SNAP_TARGET_NONE;