Fix "fl_read_image() missing right and bottom pixel line" (#1066)

This commit is contained in:
ManoloFLTK 2024-09-11 22:17:07 +02:00
parent a7328d940b
commit 5cc9845f2f

View File

@ -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; hs = (h+1) * s;
} }
#endif #endif
if (!allow_outside && win && Xs + ws >= int(win->w()*s)) ws = win->w()*s - Xs -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 -1; if (!allow_outside && win && Ys + hs > int(win->h()*s)) hs = win->h()*s - Ys;
if (ws < 1) ws = 1; if (ws < 1) ws = 1;
if (hs < 1) hs = 1; if (hs < 1) hs = 1;
if (!win || (dx >= sx && dy >= sy && dx + ws <= sx+sw && dy + hs <= sy+sh) ) { if (!win || (dx >= sx && dy >= sy && dx + ws <= sx+sw && dy + hs <= sy+sh) ) {