diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-24 14:52:36 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-24 14:52:47 +0100 |
| commit | bef46b5cb82464713a117b9bdb920735d1b7de37 (patch) | |
| tree | e645da2fdd342a8a8a41c90b54b2e96e29d849a0 /src/drivers/WinAPI | |
| parent | 9f84fd05e8090c3b7554c965d15ac5c41a0d4852 (diff) | |
Improve precision of GUI scaling for Windows platform.
Diffstat (limited to 'src/drivers/WinAPI')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index 7c57d08f2..eb437b965 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -20,7 +20,7 @@ #include "../GDI/Fl_Font.H" #include <FL/Fl.H> #include <FL/platform.H> -#include <FL/Fl_Graphics_Driver.H> +#include "../GDI/Fl_GDI_Graphics_Driver.H" #include <FL/Fl_RGB_Image.H> #include <FL/fl_ask.H> #include <stdio.h> @@ -499,14 +499,14 @@ Fl_WinAPI_Screen_Driver::read_win_rectangle( { float s = Fl_Surface_Device::surface()->driver()->scale(); int ws, hs; - if (int(s) == s) { ws = int(w * s); hs = int(h * s);} + if (int(s) == s) { ws = w * int(s); hs = h * int(s);} else { - ws = int((w+1) * s); // approximates what Fl_Graphics_Driver::cache_size() does - hs = int((h+1) * s); + ws = Fl_GDI_Graphics_Driver::floor(w+1, s); // approximates what Fl_Graphics_Driver::cache_size() does + hs = Fl_GDI_Graphics_Driver::floor(h+1, s); if (ws < 1) ws = 1; if (hs < 1) hs = 1; } - return read_win_rectangle_unscaled(int(X*s), int(Y*s), ws, hs, win); + return read_win_rectangle_unscaled(Fl_GDI_Graphics_Driver::floor(X, s), Fl_GDI_Graphics_Driver::floor(Y, s), ws, hs, win); } Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, int w, int h, Fl_Window *win) |
