diff options
| author | Manolo Gouy <Manolo> | 2018-05-03 08:37:58 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-05-03 08:37:58 +0000 |
| commit | bd4679f8d4fdfe7e8cec72865358370df6e56292 (patch) | |
| tree | 1518f88c22bbca56455e6ccc3583592cee6e38eb /src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | |
| parent | 5da16bbd36ebfb76f4af296929aa961c0bfc036a (diff) | |
Fix fl_overlay_rect() under X11 and Windows when GUI is scaled.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12891 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index a675d1620..d93a2df6d 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -503,7 +503,15 @@ Fl_WinAPI_Screen_Driver::read_win_rectangle( int h) // I - Height of area to read { float s = Fl_Surface_Device::surface()->driver()->scale(); - return read_win_rectangle_unscaled(X*s, Y*s, w*s, h*s); + int ws, hs; + if (int(s) == s) { ws = w * s; hs = h * s;} + else { + ws = (w+1)*s-1; + hs = (h+1)*s-1; + if (ws < 1) ws = 1; + if (hs < 1) hs = 1; + } + return read_win_rectangle_unscaled(X*s, Y*s, ws, hs); } Fl_RGB_Image *Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled(int X, int Y, int w, int h) |
