Fix colour shift in Crop function due to not multiplying x position by colours
This commit is contained in:
parent
49e9bf86fa
commit
f868d92269
|
@ -1467,7 +1467,7 @@ bool Image::Crop( unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsig
|
|||
uint8_t *new_buffer = AllocBuffer(new_size);
|
||||
|
||||
for ( unsigned int y = lo_y, ny = 0; y <= hi_y; y++, ny++ ) {
|
||||
unsigned char *pbuf = &buffer[((y*linesize)+lo_x)];
|
||||
unsigned char *pbuf = &buffer[((y*linesize)+(lo_x*colours))];
|
||||
unsigned char *pnbuf = &new_buffer[ny*new_stride];
|
||||
memcpy(pnbuf, pbuf, new_stride);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue