diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index efe0479bf1..8dac4ccae6 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -648,6 +648,8 @@ extern int display_yres; void TouchTestScreen::render() { UIDialogScreenWithBackground::render(); UIContext *ui_context = screenManager()->getUIContext(); + Bounds bounds = ui_context->GetLayoutBounds(); + ui_context->BeginNoTex(); for (int i = 0; i < MAX_TOUCH_POINTS; i++) { if (touches_[i].id != -1) { @@ -685,7 +687,7 @@ void TouchTestScreen::render() { g_dpi_scale_x, g_dpi_scale_y, g_dpi_scale_real_x, g_dpi_scale_real_y); - ui_context->DrawTextShadow(buffer, 20.0f, dp_yres / 2.0f, 0xFFFFFFFF, ALIGN_VCENTER | FLAG_DYNAMIC_ASCII); + ui_context->DrawTextShadow(buffer, bounds.x + 20.0f, dp_yres / 2.0f, 0xFFFFFFFF, ALIGN_VCENTER | FLAG_DYNAMIC_ASCII); ui_context->Flush(); } diff --git a/UI/GPUDriverTestScreen.cpp b/UI/GPUDriverTestScreen.cpp index f9bda115a2..dfad8aecb4 100644 --- a/UI/GPUDriverTestScreen.cpp +++ b/UI/GPUDriverTestScreen.cpp @@ -232,7 +232,6 @@ void GPUDriverTestScreen::DiscardTest() { UIContext &dc = *screenManager()->getUIContext(); Draw::DrawContext *draw = dc.GetDrawContext(); - const Bounds &bounds = dc.GetBounds(); static const char * const writeModeNames[] = { "Stencil+Depth", "Stencil", "Depth" }; Pipeline *writePipelines[] = { discardWriteDepthStencil_, discardWriteStencil_, discardWriteDepth_ }; @@ -263,14 +262,16 @@ void GPUDriverTestScreen::DiscardTest() { // If everything is OK, both the background and the text should be OK. + Bounds layoutBounds = dc.GetLayoutBounds(); + dc.Begin(); dc.SetFontScale(1.0f, 1.0f); std::string apiName = screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME); std::string vendor = screenManager()->getDrawContext()->GetInfoString(InfoField::VENDORSTRING); std::string driver = screenManager()->getDrawContext()->GetInfoString(InfoField::DRIVER); - dc.DrawText(apiName.c_str(), bounds.centerX(), 20, 0xFFFFFFFF, ALIGN_CENTER); - dc.DrawText(vendor.c_str(), bounds.centerX(), 60, 0xFFFFFFFF, ALIGN_CENTER); - dc.DrawText(driver.c_str(), bounds.centerX(), 100, 0xFFFFFFFF, ALIGN_CENTER); + dc.DrawText(apiName.c_str(), layoutBounds.centerX(), 20, 0xFFFFFFFF, ALIGN_CENTER); + dc.DrawText(vendor.c_str(), layoutBounds.centerX(), 60, 0xFFFFFFFF, ALIGN_CENTER); + dc.DrawText(driver.c_str(), layoutBounds.centerX(), 100, 0xFFFFFFFF, ALIGN_CENTER); dc.Flush(); float testW = 170.f; @@ -279,9 +280,9 @@ void GPUDriverTestScreen::DiscardTest() { float y = 150; for (int j = 0; j < numWriteModes; j++, y += 120.f + padding) { - float x = (dc.GetBounds().w - (float)numTests * testW - (float)(numTests - 1) * padding) / 2.0f; + float x = layoutBounds.x + (layoutBounds.w - (float)numTests * testW - (float)(numTests - 1) * padding) / 2.0f; dc.Begin(); - dc.DrawText(writeModeNames[j], padding, y + 40, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); + dc.DrawText(writeModeNames[j], layoutBounds.x + padding, y + 40, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); dc.Flush(); for (int i = 0; i < numTests; i++, x += testW + padding) { if (!validCombinations[j][i]) diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 7fc27f301c..76f7a0aca5 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -746,7 +746,7 @@ void CreditsScreen::render() { UIContext &dc = *screenManager()->getUIContext(); dc.Begin(); - const Bounds &bounds = dc.GetBounds(); + const Bounds &bounds = dc.GetLayoutBounds(); const int numItems = ARRAY_SIZE(credits); int itemHeight = 36; @@ -758,7 +758,7 @@ void CreditsScreen::render() { if (alpha > 0.0f) { dc.SetFontScale(ease(alpha), ease(alpha)); - dc.DrawText(credits[i], dc.GetBounds().centerX(), y, textColor, ALIGN_HCENTER); + dc.DrawText(credits[i], bounds.centerX(), y, textColor, ALIGN_HCENTER); dc.SetFontScale(1.0f, 1.0f); } y += itemHeight;