This commit is contained in:
2026-01-29 12:02:17 +01:00
parent 01992ca864
commit e64a36e178
2 changed files with 15 additions and 10 deletions
+14 -9
View File
@@ -46,11 +46,11 @@ void addNewTextNode
text_nodes[i].pos_x = pos_x; text_nodes[i].pos_x = pos_x;
text_nodes[i].pos_y = pos_y; 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; 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) 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) if (reset_cursor)
{ {
cursor.x = text_nodes[i].pos_x; cursor.x = text_nodes[i].pos_x;
cursor.y = text_nodes[i].pos_y; cursor.y = text_nodes[i].pos_y;
} }
for (unsigned char j = 0; j < text_nodes[i].character_count; j++) 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) if (!text_nodes[i].is_deleted && text_nodes[i].is_scrolling)
{ {
short x1 = text_nodes[i].pos_x; unsigned short x1 = text_nodes[i].pos_x;
short y1 = text_nodes[i].pos_y; unsigned short y1 = text_nodes[i].pos_y;
short x2 = getTextNodeX2(&text_nodes[i]); unsigned short x2 = getTextNodeX2(&text_nodes[i]);
short y2 = getTextNodeY2(&text_nodes[i]); unsigned short y2 = getTextNodeY2(&text_nodes[i]);
if (split_scroll_mode || text_nodes[i].pos_y < 7) if (split_scroll_mode || text_nodes[i].pos_y < 7)
{ {
if (x2 == 0) if (x2 == 0)
@@ -149,7 +154,7 @@ void loop()
handle_server(); handle_server();
if (text_nodes[0].is_deleted && text_nodes[1].is_deleted) if (text_nodes[0].is_deleted && text_nodes[1].is_deleted)
{ {
addNewTextNode("test", 0xFF121212); addNewTextNode("test", 0xFF121212, 100);
drawTextNodes(); drawTextNodes();
} }
} }