Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Feb 20, 2025
1 parent d3e80ea commit 34b61df
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -5128,7 +5128,7 @@ RGFW_monitor RGFW_XCreateMonitor(i32 screen) {
RGFW_MEMCPY(monitor.name, name, 128);

float dpi = XGetSystemContentDPI(display, screen);
monitor.pixelRatio = dpi / 96.0f;
monitor.pixelRatio = dpi > 96.0f ? 2 : 1;
monitor.scaleX = (float) (dpi) / 96.0f;
monitor.scaleY = (float) (dpi) / 96.0f;

Expand Down Expand Up @@ -6889,6 +6889,8 @@ RGFW_monitor win32CreateMonitor(HMONITOR src) {

monitor.scaleX = dpiX / 96.0f;
monitor.scaleY = dpiY / 96.0f;
printf("%f\n",dpiX);
monitor.pixelRatio = dpiX > 96.0f ? 2 : 1;

monitor.physW = GetDeviceCaps(hdc, HORZSIZE) / 25.4;
monitor.physH = GetDeviceCaps(hdc, VERTSIZE) / 25.4;
Expand All @@ -6901,12 +6903,9 @@ RGFW_monitor win32CreateMonitor(HMONITOR src) {
if (GetDpiForMonitor != NULL) {
u32 x, y;
GetDpiForMonitor(src, MDT_EFFECTIVE_DPI, &x, &y);
//monitor.scaleX = x / 96.0f;
//monitor.scaleY = y / 96.0f;

GetDpiForMonitor(src, MDT_EFFECTIVE_DPI, &x, &y);
monitor.pixelRatio = (float) (x) / (float) dpiX;
monitor.pixelRatio = (float) (y) / (float) dpiY;
monitor.scaleX = (float) (x) / (float) 96.0f;
monitor.scaleY = (float) (y) / (float) 96.0f;
monitor.pixelRatio = dpiX > 96.0f ? 2 : 1;
}
#endif

Expand Down

0 comments on commit 34b61df

Please sign in to comment.