Skip to content

Commit

Permalink
fixup! use only dpi scale based on x
Browse files Browse the repository at this point in the history
  • Loading branch information
redthing1 committed Oct 12, 2024
1 parent b7f58ee commit 3fca36e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/nuidemo/source/gui_root.d
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GuiRoot : Component, Renderable2D, Updatable {
auto ui_font = raylib.LoadFontEx("./res/SourceSansPro-Regular.ttf", UI_FS, null, 0);
raylib.SetTextureFilter(ui_font.texture, raylib.TextureFilter.TEXTURE_FILTER_POINT);
ctx = InitNuklearEx(ui_font, UI_FS);
ui_scale = Core.window.dpi_max_scale * Core.render_oversample_factor;
ui_scale = Core.window.dpi_scale * Core.render_oversample_factor;
SetNuklearScaling(ctx, ui_scale);
apply_style(ctx);

Expand Down
2 changes: 1 addition & 1 deletion demo/nuidemo/source/gui_scene.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GuiScene : Scene2D {

override void render_hook() {
// draw fps in bottom right corner
auto ui_scale = cast(int)(Core.window.dpi_max_scale * Core.render_oversample_factor);
auto ui_scale = cast(int)(Core.window.dpi_scale * Core.render_oversample_factor);
auto font_size = 16 * ui_scale;
raylib.DrawText(
format("%s", Core.fps).c_str(),
Expand Down

0 comments on commit 3fca36e

Please sign in to comment.