scrolling fully works now, small y have been changed
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user