@@ -191,8 +191,8 @@ static int32_t app_acc_worker(void* ctx) {
191
191
bool is_bitmap_window = 0 ; // Check if
192
192
// FuriMutex *mutex = appAcc->mutex;
193
193
194
- uint8_t column = 0 ; // Column of the bitmap array
195
- uint8_t column_directed = 0 ; // Column of the bitmap array
194
+ int16_t column = 0 ; // Column of the bitmap array
195
+ int16_t column_directed = 0 ; // Column of the bitmap array
196
196
197
197
uint8_t row = 0 ;
198
198
@@ -293,30 +293,20 @@ static int32_t app_acc_worker(void* ctx) {
293
293
// Get current column to be displayed.
294
294
column = appAcc -> cycles - ((appAcc -> cyclesCenter ) - (bitmapMatrix -> width / 2 ));
295
295
296
+ // Computes the window in which the text is displayed.
297
+ is_bitmap_window = (column >= 0 ) && (column < bitmapMatrix -> width );
298
+
296
299
// Swipe direction, according to orientation
297
- if (appAcc -> direction ^ light_msg_data -> orientation ) {
298
- column_directed = ( column % bitmapMatrix -> width ) - appAcc -> direction ;
300
+ if (appAcc -> direction ^ light_msg_data -> orientation ^ light_msg_data -> mirror ) {
301
+ column_directed = column ;
299
302
} else {
300
- column_directed =
301
- bitmapMatrix -> width - (column % (bitmapMatrix -> width )) - appAcc -> direction ;
303
+ column_directed = bitmapMatrix -> width - column - 1 ;
302
304
}
303
305
304
- // Computes the window in which the text is displayed.
305
- // low limit = center - len / 2
306
- // high limit = center + len / 2
307
- is_bitmap_window =
308
- (appAcc -> cycles >
309
- (appAcc -> cyclesCenter - ((bitmapMatrix -> width - appAcc -> direction ) / 2 ))) &&
310
- (appAcc -> cycles <=
311
- (appAcc -> cyclesCenter + ((bitmapMatrix -> width - appAcc -> direction ) / 2 )));
312
-
313
306
// Update the color according to the current shader
314
307
shader (time , appAcc -> direction ^ light_msg_data -> orientation , color , app );
315
308
316
309
if (is_bitmap_window ) {
317
- if (light_msg_data -> mirror ) {
318
- column_directed = bitmapMatrix -> width - column_directed ;
319
- }
320
310
// Draws each rows for each collumns
321
311
for (row = 0 ; row < LIGHTMSG_LED_ROWS ; row ++ ) {
322
312
pixel = (uint8_t )(bitmapMatrix -> array [row ][column_directed ]);
0 commit comments