diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-11-02 11:41:42 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-11-02 11:41:42 +0100 |
| commit | da29db9f9c3b789cd31921cb30a1418392d4214f (patch) | |
| tree | eb6feb2da36bd916093394655774962bfb5601df | |
| parent | ecdb386f3da9d70c45c601d3456c2e32d95a3863 (diff) | |
Slightly simpler code to support fl_overlay_rect() on HighDPI screens.
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index e95d3754b..b6781914e 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -204,9 +204,7 @@ unsigned Fl_Graphics_Driver::font_desc_size() { scale() and in slightly modifying that to help support tiled images. */ void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) { - if ( int(scale()) == scale() - || width==1 || height==1 // to cover fl_overlay_clear - ) { + if ( int(scale()) == scale() ) { width = width * scale(); height = height * scale(); } else { diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index edbfba577..f87ae8df3 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -495,8 +495,8 @@ Fl_WinAPI_Screen_Driver::read_win_rectangle( int ws, hs; if (int(s) == s) { ws = w * s; hs = h * s;} else { - ws = (w+1)*s-1; - hs = (h+1)*s-1; + ws = (w+1)*s; // matches what Fl_Graphics_Driver::cache_size() does + hs = (h+1)*s; if (ws < 1) ws = 1; if (hs < 1) hs = 1; } diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index b8056ff0d..0e1864291 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -796,6 +796,8 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int sx *= s; sy *= s; sw *= s; sh *= s; } if (win && !allow_outside && int(s) != s) { + ws = (w+1) * s; // matches what Fl_Graphics_Driver::cache_size() does + hs = (h+1) * s; if (Xs + ws >= int(win->w()*s)) ws = win->w()*s - Xs -1; if (Ys + hs >= int(win->h()*s)) hs = win->h()*s - Ys -1; } |
