Skip to content

Shifting and image causes it to be resized. #718

@Blockguy24

Description

@Blockguy24

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions