Merge pull request #1536 from TG-Techie/patch-4

DISPIO: end_x can't be > height of shape
This commit is contained in:
Dan Halbert 2019-02-12 19:17:10 -05:00 committed by GitHub
commit 66b0c67f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y
if (y < 0 || y >= self->height || (self->mirror_y && y > self->half_height)) {
mp_raise_ValueError(translate("y value out of bounds"));
}
if (start_x < 0 || start_x > self->width || end_x < 0 || end_x > self->height) {
if (start_x < 0 || start_x > self->width || end_x < 0 || end_x > self->width) {
mp_raise_ValueError(translate("x value out of bounds"));
}
uint16_t half_width = self->width / 2 - 1 + self->width % 2;