diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f8db599 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Make", + "command": "make", + "args": ["-s"], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "silent" + } + } + ] +} \ No newline at end of file diff --git a/source/gui.cpp b/source/gui.cpp index 6951c8f..ce0ec7e 100644 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -119,7 +119,11 @@ void Gui::DrawString(float x, float y, float size, u32 color, std::string Text, C2D_Text c2d_text; C2D_TextParse(&c2d_text, sizeBuf, Text.c_str()); C2D_TextOptimize(&c2d_text); - C2D_DrawText(&c2d_text, C2D_WithColor, x, y, 0.5f, std::min(size, size*(maxWidth/Gui::GetStringWidth(size, Text))), size, color); + if(maxWidth == 0) { + C2D_DrawText(&c2d_text, C2D_WithColor, x, y, 0.5f, size, size, color); + } else { + C2D_DrawText(&c2d_text, C2D_WithColor, x, y, 0.5f, std::min(size, size*(maxWidth/Gui::GetStringWidth(size, Text))), size, color); + } } diff --git a/source/screens/mainMenu.cpp b/source/screens/mainMenu.cpp index dffabbc..53f4f1f 100644 --- a/source/screens/mainMenu.cpp +++ b/source/screens/mainMenu.cpp @@ -38,7 +38,7 @@ extern bool touching(touchPosition touch, Structs::ButtonPos button); void MainMenu::Draw(void) const { Gui::DrawTop(); Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400); - Gui::DrawString(395-Gui::GetStringWidth(0.72f, VERSION_STRING), 218, 0.72f, Config::TxtColor, VERSION_STRING); + Gui::DrawString(397-Gui::GetStringWidth(0.5f, VERSION_STRING), 237-Gui::GetStringHeight(0.5f, VERSION_STRING), 0.5f, Config::TxtColor, VERSION_STRING); Gui::DrawBottom(); for (int i = 0; i < 3; i++) {