diff options
-rw-r--r-- | main/main.cpp | 8 | ||||
-rw-r--r-- | scene/gui/scroll_container.cpp | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp index 7015902e19..2f92451844 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -292,7 +292,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --export-pack <preset> <path> Same as --export, but only export the game pack for the given preset. The <path> extension determines whether it will be in PCK or ZIP format.\n"); OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n"); OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n"); - OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects).\n"); + OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.\n"); #ifdef DEBUG_METHODS_ENABLED OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n"); #endif @@ -2112,8 +2112,12 @@ bool Main::iteration() { #ifdef TOOLS_ENABLED if (auto_build_solutions) { auto_build_solutions = false; + // Only relevant when running the editor. + if (!editor) { + ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but no project is being edited. Aborting."); + } if (!EditorNode::get_singleton()->call_build()) { - ERR_FAIL_V(true); + ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but the build callback failed. Aborting."); } } #endif diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index dc1183df74..4712f4cb9d 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -420,6 +420,9 @@ void ScrollContainer::update_scrollbars() { v_scroll->hide(); scroll.y = 0; + + // modify the horizontal scrollbar's right anchor to fill the container's width + h_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0); } else { v_scroll->show(); @@ -431,12 +434,18 @@ void ScrollContainer::update_scrollbars() { } scroll.y = v_scroll->get_value(); + + // modify the horizontal scrollbar's right anchor to stop at the left of the vertical scrollbar + h_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -vmin.width); } if (hide_scroll_h) { h_scroll->hide(); scroll.x = 0; + + // modify the vertical scrollbar's bottom anchor to fill the container's height + v_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0); } else { h_scroll->show(); @@ -448,6 +457,9 @@ void ScrollContainer::update_scrollbars() { } scroll.x = h_scroll->get_value(); + + // modify the vertical scrollbar's bottom anchor to stop at the top of the horizontal scrollbar + v_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -hmin.height); } } |