Get use of raster attributes in the right order, from aizumusheer2 at gmail dot

com in GitHub issue 5225.
This commit is contained in:
Nicholas Marriott
2026-06-19 09:24:48 +01:00
parent 55b2e748e7
commit 12fdcea8b8

View File

@@ -450,11 +450,11 @@ sixel_scale(struct sixel_image *si, u_int xpixel, u_int ypixel, u_int ox,
new->set_ra = si->set_ra;
/* subtract offset */
new->ra_x = new->ra_x > pox ? new->ra_x - pox : 0;
new->ra_y = new->ra_y > poy ? new->ra_y - poy : 0;
new->ra_x = si->ra_x > pox ? si->ra_x - pox : 0;
new->ra_y = si->ra_y > poy ? si->ra_y - poy : 0;
/* clamp to size */
new->ra_x = si->ra_x < psx ? si->ra_x : psx;
new->ra_y = si->ra_y < psy ? si->ra_y : psy;
new->ra_x = new->ra_x < psx ? new->ra_x : psx;
new->ra_y = new->ra_y < psy ? new->ra_y : psy;
/* resize */
new->ra_x = new->ra_x * xpixel / si->xpixel;
new->ra_y = new->ra_y * ypixel / si->ypixel;