*/}}
Selaa lähdekoodia

win32 getdpi fix

YimingWu 2 viikkoa sitten
vanhempi
commit
c160561aca
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 1 1
      la_kernel.c
  2. 5 0
      resources/la_properties.c

+ 1 - 1
la_kernel.c

@@ -980,7 +980,7 @@ static BOOL CALLBACK la_Win32MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprcMoni
 int la_GetDPI(HWND win){
     laWin32MonitorEnumData data = { 0 };
     EnumDisplayMonitors(0, 0, la_Win32MonitorEnum, (LPARAM)&data);
-    return GetDpiForWindow(win);
+    if(win) return GetDpiForWindow(win);
     return 144;
 }
 #endif

+ 5 - 0
resources/la_properties.c

@@ -771,7 +771,12 @@ void lapost_Block(laBlock *b){
 void lapost_UserPreferences(void* unused){
     //MAIN.ScaledUiRowHeight=MAIN.UiRowHeight;
     //tnsInvalidateFontCache();
+#ifdef _WIN32
+    la_GetDPI(0);
+#endif
+#ifdef LA_LINUX
     la_GetDPI(MAIN.win);
+#endif
 }
 void laset_ColorPickerGamma(void* unused, real gamma){
     MAIN.ColorPickerGamma=gamma; laRedrawCurrentWindow();