diff --git a/ledy.ino b/ledy.ino index 9608b6d..1b5eae1 100644 --- a/ledy.ino +++ b/ledy.ino @@ -46,13 +46,6 @@ 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]); - - if (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.width = is_small ? SMALL_TEXT_WIDTH : MEDIUM_TEXT_WIDTH; text_nodes[i].character_count = text_length; @@ -71,10 +64,11 @@ 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) + 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; + text_nodes[i].pos_x -= POS_X2 - PANEL_MAX_X; } if (reset_cursor)