@@ -96,10 +96,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
96
96
x = self -> absolute_transform -> x + self -> absolute_transform -> dx * self -> y ;
97
97
y = self -> absolute_transform -> y + self -> absolute_transform -> dy * self -> x ;
98
98
if (self -> absolute_transform -> dx < 1 ) {
99
+ x -= 1 ;
99
100
out_area -> y1 = out_area -> y1 * -1 + 1 ;
100
101
out_area -> y2 = out_area -> y2 * -1 + 1 ;
101
102
}
102
103
if (self -> absolute_transform -> dy < 1 ) {
104
+ y -= 1 ;
103
105
out_area -> x1 = out_area -> x1 * -1 + 1 ;
104
106
out_area -> x2 = out_area -> x2 * -1 + 1 ;
105
107
}
@@ -109,10 +111,12 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou
109
111
y = self -> absolute_transform -> y + self -> absolute_transform -> dy * self -> y ;
110
112
111
113
if (self -> absolute_transform -> dx < 1 ) {
114
+ x -= 1 ;
112
115
out_area -> x1 = out_area -> x1 * -1 + 1 ;
113
116
out_area -> x2 = out_area -> x2 * -1 + 1 ;
114
117
}
115
118
if (self -> absolute_transform -> dy < 1 ) {
119
+ y -= 1 ;
116
120
out_area -> y1 = out_area -> y1 * -1 + 1 ;
117
121
out_area -> y2 = out_area -> y2 * -1 + 1 ;
118
122
}
@@ -132,24 +136,25 @@ static void screen_to_shape_coordinates(vectorio_vector_shape_t *self, uint16_t
132
136
VECTORIO_SHAPE_PIXEL_DEBUG (" a(%3d, %3d)" , * out_shape_x , * out_shape_y );
133
137
if (self -> absolute_transform -> dx < 1 ) {
134
138
* out_shape_y *= -1 ;
139
+ * out_shape_y -= 1 ;
135
140
}
136
141
if (self -> absolute_transform -> dy < 1 ) {
137
142
* out_shape_x *= -1 ;
143
+ * out_shape_x -= 1 ;
138
144
}
139
- VECTORIO_SHAPE_PIXEL_DEBUG (" b(%3d, %3d)" , * out_shape_x , * out_shape_y );
140
145
} else {
141
146
* out_shape_x = x - self -> absolute_transform -> x - self -> absolute_transform -> dx * self -> x ;
142
147
* out_shape_y = y - self -> absolute_transform -> y - self -> absolute_transform -> dy * self -> y ;
143
148
144
149
VECTORIO_SHAPE_PIXEL_DEBUG (" a(%3d, %3d)" , * out_shape_x , * out_shape_y );
145
150
if (self -> absolute_transform -> dx < 1 ) {
146
151
* out_shape_x *= -1 ;
152
+ * out_shape_x -= 1 ;
147
153
}
148
154
if (self -> absolute_transform -> dy < 1 ) {
149
155
* out_shape_y *= -1 ;
156
+ * out_shape_y -= 1 ;
150
157
}
151
- VECTORIO_SHAPE_PIXEL_DEBUG (" b(%3d, %3d)" , * out_shape_x , * out_shape_y );
152
-
153
158
// It's mirrored via dx. Maybe we need to add support for also separately mirroring?
154
159
// if (self->absolute_transform->mirror_x) {
155
160
// 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
158
163
// pixel_to_get_y = (shape_area.y2 - shape_area.y1) - (pixel_to_get_y - shape_area.y1) + +shape_area.y1 - 1;
159
164
// }
160
165
}
166
+ VECTORIO_SHAPE_PIXEL_DEBUG (" b(%3d, %3d)" , * out_shape_x , * out_shape_y );
161
167
}
162
168
163
169
static void check_bounds_and_set_x (vectorio_vector_shape_t * self , mp_int_t x ) {
0 commit comments