fix vectorio rotation issue

This commit is contained in:
foamyguy 2024-12-01 20:37:19 -06:00
parent 68cdc535b2
commit a32a318ab3

View file

@ -96,10 +96,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
x = self->absolute_transform->x + self->absolute_transform->dx * self->y;
y = self->absolute_transform->y + self->absolute_transform->dy * self->x;
if (self->absolute_transform->dx < 1) {
x -= 1;
out_area->y1 = out_area->y1 * -1 + 1;
out_area->y2 = out_area->y2 * -1 + 1;
}
if (self->absolute_transform->dy < 1) {
y -= 1;
out_area->x1 = out_area->x1 * -1 + 1;
out_area->x2 = out_area->x2 * -1 + 1;
}
@ -109,10 +111,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
y = self->absolute_transform->y + self->absolute_transform->dy * self->y;
if (self->absolute_transform->dx < 1) {
x -= 1;
out_area->x1 = out_area->x1 * -1 + 1;
out_area->x2 = out_area->x2 * -1 + 1;
}
if (self->absolute_transform->dy < 1) {
y -= 1;
out_area->y1 = out_area->y1 * -1 + 1;
out_area->y2 = out_area->y2 * -1 + 1;
}
@ -132,9 +136,11 @@ static void screen_to_shape_coordinates(vectorio_vector_shape_t *self, uint16_t
VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", *out_shape_x, *out_shape_y);
if (self->absolute_transform->dx < 1) {
*out_shape_y *= -1;
*out_shape_y -= 1;
}
if (self->absolute_transform->dy < 1) {
*out_shape_x *= -1;
*out_shape_x -= 1;
}
VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", *out_shape_x, *out_shape_y);
} else {
@ -144,9 +150,11 @@ static void screen_to_shape_coordinates(vectorio_vector_shape_t *self, uint16_t
VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", *out_shape_x, *out_shape_y);
if (self->absolute_transform->dx < 1) {
*out_shape_x *= -1;
*out_shape_x -= 1;
}
if (self->absolute_transform->dy < 1) {
*out_shape_y *= -1;
*out_shape_y -= 1;
}
VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", *out_shape_x, *out_shape_y);