Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifting and image causes it to be resized. #718

Closed
Blockguy24 opened this issue Jun 14, 2021 · 1 comment
Closed

Shifting and image causes it to be resized. #718

Blockguy24 opened this issue Jun 14, 2021 · 1 comment
Milestone

Comments

@Blockguy24
Copy link
Contributor

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:

greyscale_t *image_shift(microbit_image_obj_t *self, mp_int_t x, mp_int_t y) {
greyscale_t *result = greyscale_new(self->width(), self->width());
image_blit(self, result, x, y, self->width(), self->width(), 0, 0);
return result;
}

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.

@dpgeorge
Copy link
Member

dpgeorge commented Sep 6, 2021

Fixed by 4cdc4ac

@dpgeorge dpgeorge closed this as completed Sep 6, 2021
@microbit-carlos microbit-carlos added this to the Version 1.1 milestone Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants