summaryrefslogtreecommitdiffstats
path: root/main/main.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-09-07 11:22:07 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-09-07 11:22:07 -0300
commit1eeda0f32f66b48c8df3b93f333bf702b149ba31 (patch)
treeb274e9ebd9ee64edc0a412ab48d3a2ff98b54f49 /main/main.cpp
parent895140389a7306eafc9a36f51d892ece0001f223 (diff)
downloadredot-engine-1eeda0f32f66b48c8df3b93f333bf702b149ba31.tar.gz
Restored auto snapping of controls to pixels, fixes #10847 and probably several more issues. Made it optional in the project settings but defaults to true.
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 7b2a890a8e..fe07ba484d 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1325,6 +1325,7 @@ bool Main::start() {
int shadow_atlas_q2_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_2_subdiv");
int shadow_atlas_q3_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_3_subdiv");
+
sml->get_root()->set_shadow_atlas_size(shadow_atlas_size);
sml->get_root()->set_shadow_atlas_quadrant_subdiv(0, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q0_subdiv));
sml->get_root()->set_shadow_atlas_quadrant_subdiv(1, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q1_subdiv));
@@ -1333,6 +1334,9 @@ bool Main::start() {
Viewport::Usage usage = Viewport::Usage(int(GLOBAL_GET("rendering/quality/intended_usage/framebuffer_allocation")));
sml->get_root()->set_usage(usage);
+ bool snap_controls = GLOBAL_DEF("gui/common/snap_controls_to_pixels", true);
+ sml->get_root()->set_snap_controls_to_pixels(snap_controls);
+
} else {
GLOBAL_DEF("display/window/stretch/mode", "disabled");
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/mode", PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport"));
@@ -1342,6 +1346,8 @@ bool Main::start() {
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::STRING, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,1"));
sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
+ GLOBAL_DEF("gui/common/snap_controls_to_pixels", true);
+
}
String local_game_path;