Skip to content

Commit

Permalink
feat: Improve appearance of OOB banner
Browse files Browse the repository at this point in the history
Rendering at a non-native resolution and then scaling the bitmap
looks bad. The scaling seems to try to just get it to end up the
same size as the welcome screen, so just use the same size for
both.
  • Loading branch information
csnover committed Jul 17, 2024
1 parent fdf2529 commit f55532d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/builtin/source/content/out_of_box_experience.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace hex::plugin::builtin {

// Draw banner
ImGui::SetCursorPos(scaled({ 25 * bannerSlideIn, 25 }));
const auto bannerSize = s_imhexBanner.getSize() / (3.0F * (1.0F / ImHexApi::System::getGlobalScale()));
const auto bannerSize = s_imhexBanner.getSize();
ImGui::Image(
s_imhexBanner,
bannerSize,
Expand Down Expand Up @@ -443,7 +443,7 @@ namespace hex::plugin::builtin {

const auto imageTheme = ThemeManager::getImageTheme();
const auto scale = ImHexApi::System::getContentScale();
s_imhexBanner = ImGuiExt::Texture::fromSVG(romfs::get(hex::format("assets/{}/banner.svg", imageTheme)).span<std::byte>(), 0, 0, scale);
s_imhexBanner = ImGuiExt::Texture::fromSVG(romfs::get(hex::format("assets/{}/banner.svg", imageTheme)).span<std::byte>(), 300_scaled, 0, scale);
s_compassTexture = ImGuiExt::Texture::fromImage(romfs::get("assets/common/compass.png").span<std::byte>());
s_globeTexture = ImGuiExt::Texture::fromImage(romfs::get("assets/common/globe.png").span<std::byte>());
s_screenshotDescriptions = nlohmann::json::parse(romfs::get("assets/screenshot_descriptions.json").string());
Expand Down

0 comments on commit f55532d

Please sign in to comment.