@@ -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
163169static void check_bounds_and_set_x (vectorio_vector_shape_t * self , mp_int_t x ) {
0 commit comments