Skip to content

Commit b7f58ee

Browse files
committed
use only dpi scale based on x
1 parent 0b36bfc commit b7f58ee

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

source/re/core.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ abstract class Core {
352352
private void calculate_render_resolution() {
353353
// since window was resized, update our render resolution
354354
// first get the new window size
355-
auto render_res_x = window.render_width * window.dpi_scale_x;
356-
auto render_res_y = window.render_height * window.dpi_scale_y;
355+
auto render_res_x = window.render_width * window.dpi_scale;
356+
auto render_res_y = window.render_height * window.dpi_scale;
357357

358358
// set mouse scale
359359
auto mouse_scale_factor = 1.0 * scale_factor;
@@ -373,7 +373,7 @@ abstract class Core {
373373

374374
/// overall scale factor from screen space coordinates to render space
375375
static @property float scale_factor() {
376-
return window.dpi_max_scale * render_oversample_factor;
376+
return window.dpi_scale * render_oversample_factor;
377377
}
378378
}
379379

source/re/gfx/window.d

+3-14
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,8 @@ class Window {
4949
raylib.CloseWindow();
5050
}
5151

52-
public @property float dpi_max_scale() {
53-
auto scale_dpi_vec = raylib.GetWindowScaleDPI();
54-
return max(scale_dpi_vec.x, scale_dpi_vec.y);
55-
}
56-
57-
public @property float dpi_scale_x() {
58-
auto scale_dpi_vec = raylib.GetWindowScaleDPI();
59-
return scale_dpi_vec.x;
60-
}
61-
62-
public @property float dpi_scale_y() {
63-
auto scale_dpi_vec = raylib.GetWindowScaleDPI();
64-
return scale_dpi_vec.y;
52+
public @property float dpi_scale() {
53+
return raylib.GetWindowScaleDPI().x;
6554
}
6655

6756
public @property int screen_width() {
@@ -73,7 +62,7 @@ class Window {
7362
}
7463

7564
public @property Rectangle screen_bounds() {
76-
return Rectangle(0, 0, screen_width * Core.window.dpi_scale_x, screen_height * Core.window.dpi_scale_y);
65+
return Rectangle(0, 0, screen_width * Core.window.dpi_scale, screen_height * Core.window.dpi_scale);
7766
}
7867

7968
public @property int render_width() {

0 commit comments

Comments
 (0)