summaryrefslogtreecommitdiff
path: root/src/drivers/X11/Fl_X11_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-09-11 22:17:07 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-09-11 22:17:07 +0200
commit5cc9845f2f2805efd8e831f29810f91ad793c530 (patch)
treea32be347f5887f679ffc93c814da2a42deff0429 /src/drivers/X11/Fl_X11_Screen_Driver.cxx
parenta7328d940bea760c0773d2889809217c82fa7081 (diff)
Fix "fl_read_image() missing right and bottom pixel line" (#1066)
Diffstat (limited to 'src/drivers/X11/Fl_X11_Screen_Driver.cxx')
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index fffce8d35..5f9acfb55 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -706,8 +706,8 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int
hs = (h+1) * s;
}
#endif
- if (!allow_outside && win && Xs + ws >= int(win->w()*s)) ws = win->w()*s - Xs -1;
- if (!allow_outside && win && Ys + hs >= int(win->h()*s)) hs = win->h()*s - Ys -1;
+ if (!allow_outside && win && Xs + ws > int(win->w()*s)) ws = win->w()*s - Xs;
+ if (!allow_outside && win && Ys + hs > int(win->h()*s)) hs = win->h()*s - Ys;
if (ws < 1) ws = 1;
if (hs < 1) hs = 1;
if (!win || (dx >= sx && dy >= sy && dx + ws <= sx+sw && dy + hs <= sy+sh) ) {