Closed Blockguy24 closed 2 years ago
I was having this issue with Image where if I did something like Image(5,6).shift_down(1), it would cause it to return an image of size 5x5 instead of 5x6. After looking through the code, I saw that the width was being passed twice into the blit function: https://github.com/bbcmicrobit/micropython/blob/a92ca9b1f907c07a01116b0eb464ca4743a28bf1/source/microbit/microbitimage.cpp#L324-L328
Image
Image(5,6).shift_down(1)
It looks like self->width(), self->width() should be replaced with self->width(), self->height() on lines 325 and 326 for this to function correctly.
self->width(), self->width()
self->width(), self->height()
Fixed by 4cdc4ac219f46cb7582a469e940a5ea27bb34a1d
I was having this issue with
Image
where if I did something likeImage(5,6).shift_down(1)
, it would cause it to return an image of size 5x5 instead of 5x6. After looking through the code, I saw that the width was being passed twice into the blit function: https://github.com/bbcmicrobit/micropython/blob/a92ca9b1f907c07a01116b0eb464ca4743a28bf1/source/microbit/microbitimage.cpp#L324-L328It looks like
self->width(), self->width()
should be replaced withself->width(), self->height()
on lines 325 and 326 for this to function correctly.