Skip to content

Commit 1974908

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 355ff42 + 0c9aa80 commit 1974908

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CIRCUITPY_CODEOP = 0
1515
CIRCUITPY_FLOPPYIO = 0
1616
CIRCUITPY_JPEGIO = 0
1717
CIRCUITPY_SYNTHIO = 0
18+
CIRCUITPY_VECTORIO = 0
1819

1920
# We don't have room for the fonts for terminalio for certain languages,
2021
# so turn off terminalio, and if it's off and displayio is on,

ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CIRCUITPY_CODEOP = 0
1515
CIRCUITPY_FLOPPYIO = 0
1616
CIRCUITPY_JPEGIO = 0
1717
CIRCUITPY_SYNTHIO = 0
18+
CIRCUITPY_VECTORIO = 0
1819

1920
# We don't have room for the fonts for terminalio for certain languages,
2021
# so turn off terminalio, and if it's off and displayio is on,

ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ LONGINT_IMPL = MPZ
1313
CIRCUITPY_KEYPAD = 1
1414
CIRCUITPY_SYNTHIO = 0
1515
CIRCUITPY_JPEGIO = 0
16+
CIRCUITPY_FLOPPYIO = 0

shared-module/vectorio/VectorShape.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
9696
x = self->absolute_transform->x + self->absolute_transform->dx * self->y;
9797
y = self->absolute_transform->y + self->absolute_transform->dy * self->x;
9898
if (self->absolute_transform->dx < 1) {
99+
x -= 1;
99100
out_area->y1 = out_area->y1 * -1 + 1;
100101
out_area->y2 = out_area->y2 * -1 + 1;
101102
}
102103
if (self->absolute_transform->dy < 1) {
104+
y -= 1;
103105
out_area->x1 = out_area->x1 * -1 + 1;
104106
out_area->x2 = out_area->x2 * -1 + 1;
105107
}
@@ -109,10 +111,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
109111
y = self->absolute_transform->y + self->absolute_transform->dy * self->y;
110112

111113
if (self->absolute_transform->dx < 1) {
114+
x -= 1;
112115
out_area->x1 = out_area->x1 * -1 + 1;
113116
out_area->x2 = out_area->x2 * -1 + 1;
114117
}
115118
if (self->absolute_transform->dy < 1) {
119+
y -= 1;
116120
out_area->y1 = out_area->y1 * -1 + 1;
117121
out_area->y2 = out_area->y2 * -1 + 1;
118122
}
@@ -132,24 +136,25 @@ static void screen_to_shape_coordinates(vectorio_vector_shape_t *self, uint16_t
132136
VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", *out_shape_x, *out_shape_y);
133137
if (self->absolute_transform->dx < 1) {
134138
*out_shape_y *= -1;
139+
*out_shape_y -= 1;
135140
}
136141
if (self->absolute_transform->dy < 1) {
137142
*out_shape_x *= -1;
143+
*out_shape_x -= 1;
138144
}
139-
VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", *out_shape_x, *out_shape_y);
140145
} else {
141146
*out_shape_x = x - self->absolute_transform->x - self->absolute_transform->dx * self->x;
142147
*out_shape_y = y - self->absolute_transform->y - self->absolute_transform->dy * self->y;
143148

144149
VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", *out_shape_x, *out_shape_y);
145150
if (self->absolute_transform->dx < 1) {
146151
*out_shape_x *= -1;
152+
*out_shape_x -= 1;
147153
}
148154
if (self->absolute_transform->dy < 1) {
149155
*out_shape_y *= -1;
156+
*out_shape_y -= 1;
150157
}
151-
VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", *out_shape_x, *out_shape_y);
152-
153158
// It's mirrored via dx. Maybe we need to add support for also separately mirroring?
154159
// if (self->absolute_transform->mirror_x) {
155160
// pixel_to_get_x = (shape_area.x2 - shape_area.x1) - (pixel_to_get_x - shape_area.x1) + shape_area.x1 - 1;
@@ -158,6 +163,7 @@ static void screen_to_shape_coordinates(vectorio_vector_shape_t *self, uint16_t
158163
// pixel_to_get_y = (shape_area.y2 - shape_area.y1) - (pixel_to_get_y - shape_area.y1) + +shape_area.y1 - 1;
159164
// }
160165
}
166+
VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", *out_shape_x, *out_shape_y);
161167
}
162168

163169
static void check_bounds_and_set_x(vectorio_vector_shape_t *self, mp_int_t x) {

0 commit comments

Comments
 (0)