Skip to content

Commit 7eece7d

Browse files
committed
dirty area computed for non-transposed but at least d-1
1 parent 9897ac6 commit 7eece7d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

shared-module/vectorio/VectorShape.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,19 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
9797
x = self->absolute_transform->x + self->absolute_transform->dx * self->y;
9898
y = self->absolute_transform->y + self->absolute_transform->dy * self->x;
9999
area_transpose(out_area);
100-
displayio_area_canon(out_area);
101100
} else {
101+
if (self->absolute_transform->dx < 1) {
102+
out_area->x1 = out_area->x1 * -1 + 1;
103+
out_area->x2 = out_area->x2 * -1 + 1;
104+
}
105+
if (self->absolute_transform->dy < 1) {
106+
out_area->y1 = out_area->y1 * -1 + 1;
107+
out_area->y2 = out_area->y2 * -1 + 1;
108+
}
102109
x = self->absolute_transform->x + self->absolute_transform->dx * self->x;
103110
y = self->absolute_transform->y + self->absolute_transform->dy * self->y;
104111
}
112+
displayio_area_canon(out_area);
105113
displayio_area_shift(out_area, x, y);
106114

107115
VECTORIO_SHAPE_DEBUG(" out:{(%5d,%5d), (%5d,%5d)}\n", out_area->x1, out_area->y1, out_area->x2, out_area->y2);
@@ -313,10 +321,10 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ
313321
VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", pixel_to_get_x, pixel_to_get_y);
314322

315323
if (self->absolute_transform->mirror_x) {
316-
pixel_to_get_x = shape_area.x2 - 1 - (pixel_to_get_x - shape_area.x1);
324+
pixel_to_get_x = (shape_area.x2 - shape_area.x1) - (pixel_to_get_x + shape_area.x1) + shape_area.x1 - 1;
317325
}
318326
if (self->absolute_transform->mirror_y) {
319-
pixel_to_get_y = shape_area.y2 - 1 - (pixel_to_get_y - shape_area.y1);
327+
pixel_to_get_y = (shape_area.y2 - shape_area.y1) - (pixel_to_get_y + shape_area.y1) + +shape_area.y1 - 1;
320328
}
321329
}
322330

0 commit comments

Comments
 (0)