Fix colour shift in Crop function due to not multiplying x position by colours

This commit is contained in:
Isaac Connor 2021-02-02 23:19:06 -05:00
parent 70313ce152
commit c0eb790e45
2 changed files with 4 additions and 4 deletions

View File

@ -1416,9 +1416,9 @@ bool Image::Crop( unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsig
unsigned int new_stride = new_width * colours;
for ( unsigned int y = lo_y, ny = 0; y <= hi_y; y++, ny++ ) {
unsigned char *pbuf = &buffer[((y*linesize)+lo_x)];
unsigned char *pnbuf = &new_buffer[(ny*new_width)*colours];
memcpy( pnbuf, pbuf, new_stride );
unsigned char *pbuf = &buffer[((y*linesize)+(lo_x*colours))];
unsigned char *pnbuf = &new_buffer[ny*new_stride];
memcpy(pnbuf, pbuf, new_stride);
}
AssignDirect(new_width, new_height, colours, subpixelorder, new_buffer, new_size, ZM_BUFTYPE_ZM);

@ -1 +1 @@
Subproject commit 14292374ccf1328f2d5db20897bd06f99ba4d938
Subproject commit 0bd63fb464957080ead342db58ca9e01532cf1ef