From e64a36e178af6ba6f133cf0c79394653b8db14f0 Mon Sep 17 00:00:00 2001 From: gitProtogen Date: Thu, 29 Jan 2026 12:02:17 +0100 Subject: [PATCH] a --- ledy.ino | 23 ++++++++++++++--------- lowLevel.ino | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ledy.ino b/ledy.ino index 63551dd..9608b6d 100644 --- a/ledy.ino +++ b/ledy.ino @@ -46,11 +46,11 @@ void addNewTextNode text_nodes[i].pos_x = pos_x; text_nodes[i].pos_y = pos_y; - const unsigned short pos_x2 = getTextNodeX2(&(text_nodes)[i]); + const unsigned short POS_X2 = getTextNodeX2(&(text_nodes)[i]); - if (pos_x2 > PANEL_MAX_X) + if (POS_X2 > PANEL_MAX_X) { - text_nodes[i].pos_x -= pos_x2 - PANEL_MAX_X; + text_nodes[i].pos_x -= POS_X2 - PANEL_MAX_X; } text_nodes[i].characterSize.height = is_small ? SMALL_TEXT_HEIGHT : MEDIUM_TEXT_HEIGHT; @@ -71,11 +71,16 @@ void drawTextNodes(bool reset_cursor = true) { if (!text_nodes[i].is_deleted) { + const unsigned short POS_X2 = getTextNodeX2(&text_nodes[i]); + if (POS_X2 > PANEL_MAX_X) + { + text_nodes[i].pos_x = POS_X2 - PANEL_MAX_X; + } + if (reset_cursor) { cursor.x = text_nodes[i].pos_x; cursor.y = text_nodes[i].pos_y; - } for (unsigned char j = 0; j < text_nodes[i].character_count; j++) @@ -98,10 +103,10 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false) { if (!text_nodes[i].is_deleted && text_nodes[i].is_scrolling) { - short x1 = text_nodes[i].pos_x; - short y1 = text_nodes[i].pos_y; - short x2 = getTextNodeX2(&text_nodes[i]); - short y2 = getTextNodeY2(&text_nodes[i]); + unsigned short x1 = text_nodes[i].pos_x; + unsigned short y1 = text_nodes[i].pos_y; + unsigned short x2 = getTextNodeX2(&text_nodes[i]); + unsigned short y2 = getTextNodeY2(&text_nodes[i]); if (split_scroll_mode || text_nodes[i].pos_y < 7) { if (x2 == 0) @@ -149,7 +154,7 @@ void loop() handle_server(); if (text_nodes[0].is_deleted && text_nodes[1].is_deleted) { - addNewTextNode("test", 0xFF121212); + addNewTextNode("test", 0xFF121212, 100); drawTextNodes(); } } \ No newline at end of file diff --git a/lowLevel.ino b/lowLevel.ino index 74c0c6b..ba1ffaf 100644 --- a/lowLevel.ino +++ b/lowLevel.ino @@ -224,7 +224,7 @@ void shiftGivenRectangleRight(short x1, short y1, short x2, short y2, unsigned c if (src_x >= 0 && src_x <= PANEL_MAX_X) { color = getPixelColor(src_x, y); } - + if (dest_x >= 0 && dest_x <= PANEL_MAX_X) { setPixel(dest_x, y, color); }