scrolling both directions now works

This commit is contained in:
2026-01-28 14:28:00 +01:00
parent 856af65f6c
commit cee3b737d0
+5 -5
View File
@@ -79,13 +79,13 @@ void scrollAllScrollableTexts()
{ {
if (text_nodes[i].pos_y < 7) if (text_nodes[i].pos_y < 7)
{ {
shiftGivenRectangleLeft(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].characterSize.height, text_nodes[i].scroll_slowness); shiftGivenRectangleLeft(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].pos_x + text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].pos_y + text_nodes[i].characterSize.height - 1, text_nodes[i].scroll_slowness);
text_nodes[i].pos_x -= text_nodes[i].scroll_slowness; text_nodes[i].pos_x -= text_nodes[i].scroll_slowness;
} }
else else
{ {
shiftGivenRectangleRight(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1 , text_nodes[i].pos_y + text_nodes[i].characterSize.height, text_nodes[i].scroll_slowness); shiftGivenRectangleRight(text_nodes[i].pos_x, text_nodes[i].pos_y, text_nodes[i].pos_x + text_nodes[i].characterSize.width * text_nodes[i].character_count + text_nodes[i].character_count - 1, text_nodes[i].pos_y + text_nodes[i].characterSize.height - 1, text_nodes[i].scroll_slowness);
text_nodes[i].pos_x += text_nodes[i].scroll_slowness; text_nodes[i].pos_x += text_6nodes[i].scroll_slowness;
} }
} }
} }
@@ -98,8 +98,8 @@ void setup()
pixels.begin(); pixels.begin();
pixels.clear(); pixels.clear();
addNewTextNode("NET", 0xFF150000); addNewTextNode("NET", 0xFF050505);
addNewTextNode("FAILED", 0xFF150000, 0, 9); addNewTextNode("AWAIT", 0xFF050505, 0, 9);
drawTextNodes(); drawTextNodes();
pixels.show(); pixels.show();