From ab5ec584264310b335a3afdf834398eb552d3d36 Mon Sep 17 00:00:00 2001 From: gitProtogen Date: Fri, 30 Jan 2026 09:44:56 +0100 Subject: [PATCH] scrolling fully works now, small y have been changed --- fonts.h | 15 +++++++------- ledy.ino | 61 ++++++++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/fonts.h b/fonts.h index 694f0b9..e42b6cd 100644 --- a/fonts.h +++ b/fonts.h @@ -718,7 +718,6 @@ constexpr bool font7x5[96][7][5] = {true, false, false, false, true}, {false, true, true, true, true}, {false, false, false, false, true}, - // Note: This would typically have a 7th row showing the descender }, // h (ASCII 104) { @@ -892,13 +891,13 @@ constexpr bool font7x5[96][7][5] = }, // y (ASCII 121) { - {false, false, false, false, false}, - {false, false, false, false, false}, - {true, false, false, false, true}, - {true, false, false, false, true}, - {true, false, false, false, true}, - {false, true, true, true, true}, - {false, false, false, false, true} + {false, false, false, false, false}, + {false, false, false, false, false}, + {true, false, false, false, true}, + {true, false, false, false, true}, + {true, true, true, true, true}, + {false, false, false, false, true}, + {true, true, true, true, true} }, // z (ASCII 122) { diff --git a/ledy.ino b/ledy.ino index cff0a69..a0368f6 100644 --- a/ledy.ino +++ b/ledy.ino @@ -62,33 +62,39 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false) { for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++) { - if (text_nodes[i].is_deleted || !text_nodes[i].is_scrolling) {continue;} - if (text_nodes[i].scroll_slowness < text_nodes[i].scroll_progress) - { - text_nodes[i].scroll_progress++; - continue; - } - text_nodes[i].scroll_progress = 0;< + if (text_nodes[i].is_deleted) {continue;} - short x1 = text_nodes[i].pos_x; - short x2 = getTextNodeX2(&text_nodes[i]); - if (split_scroll_mode || text_nodes[i].pos_y < 7) + if (text_nodes[i].is_scrolling) { - if (x2 < 0) - { - text_nodes[i].is_deleted = true; - continue; - } - text_nodes[i].pos_x--; - } - else - { - if (x1 > PANEL_MAX_X) - { - text_nodes[i].is_deleted = true; - continue; - } - text_nodes[i].pos_x++; + if (text_nodes[i].scroll_slowness > text_nodes[i].scroll_progress) + { + text_nodes[i].scroll_progress++; + } + else + { + text_nodes[i].scroll_progress = 0; + + short x1 = text_nodes[i].pos_x; + short x2 = getTextNodeX2(&text_nodes[i]); + if (split_scroll_mode || text_nodes[i].pos_y < 7) + { + if (x2 < 0) + { + text_nodes[i].is_deleted = true; + continue; + } + text_nodes[i].pos_x--; + } + else + { + if (x1 > PANEL_MAX_X) + { + text_nodes[i].is_deleted = true; + continue; + } + text_nodes[i].pos_x++; + } + } } cursor.x = text_nodes[i].pos_x; @@ -125,10 +131,9 @@ void loop() { pixels.clear(); handle_server(); - if (text_nodes[0].is_deleted && text_nodes[1].is_deleted) + if (text_nodes[0].is_deleted) { - addNewTextNode("test", 0xFF121212, 49); - addNewTextNode("test", 0xFF121212, -30, 9, 10); + addNewTextNode(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", 0xFF121212, 49, 0, 1); } scrollAllScrollableTexts(); pixels.show();