Revert "Correction of the zone cropping."

This reverts commit 67c7ef9c4e.
merge-requests/213/head^2
Thierry HUCHARD 2020-03-29 21:37:25 +02:00
rodzic 67c7ef9c4e
commit 062fb40cf4
1 zmienionych plików z 13 dodań i 20 usunięć

Wyświetl plik

@ -48,18 +48,16 @@ escl_crop_surface(capabilities_t *scanner,
scanner->width = w; scanner->width = w;
if (scanner->pos_x < 0) if (scanner->pos_x < 0)
scanner->pos_x = 0; scanner->pos_x = 0;
if (scanner->width > scanner->pos_x)
x_off = scanner->pos_x;
real_w = scanner->width - x_off;
if (h < (int)scanner->height) if (h < (int)scanner->height)
scanner->height = h; scanner->height = h;
if (scanner->pos_y < 0) if (scanner->pos_x < 0)
scanner->pos_y = 0; scanner->pos_x = 0;
if (scanner->pos_y < scanner->height)
x_off = scanner->pos_x;
real_w = scanner->width - x_off;
y_off = scanner->pos_y; y_off = scanner->pos_y;
real_h = scanner->height - y_off; real_h = scanner->height - y_off;
*width = real_w; *width = real_w;
*height = real_h; *height = real_h;
if (x_off > 0 || real_w < scanner->width || if (x_off > 0 || real_w < scanner->width ||
@ -76,12 +74,7 @@ escl_crop_surface(capabilities_t *scanner,
{ {
for (x = 0; x < real_w; x++) for (x = 0; x < real_w; x++)
{ {
surface_crop[(y * real_w * bps) + (x * bps)] = surface_crop[y * real_w + x] = surface[(y + y_off) * w + x + x_off];
surface[((y + y_off) * w * bps) + ((x + x_off) * bps)];
surface_crop[(y * real_w * bps) + (x * bps) + 1] =
surface[((y + y_off) * w * bps) + ((x + x_off) * bps) + 1];
surface_crop[(y * real_w * bps) + (x * bps) + 2] =
surface[((y + y_off) * w * bps) + ((x + x_off) * bps) + 2];
} }
} }
free(surface); free(surface);