Handles character deletion from the text string and screen
| 138 | |
| 139 | /// Handles character deletion from the text string and screen |
| 140 | bool handleDelete(String ¤t_text, int &cursor_x, int &cursor_y) { |
| 141 | if (current_text.length() == 0) return false; |
| 142 | |
| 143 | // remove from string |
| 144 | current_text.remove(current_text.length() - 1); |
| 145 | // delete from screen: |
| 146 | int fontSize = FM; |
| 147 | if (current_text.length() > max_FP_size) { |
| 148 | tft->setTextSize(FP); |
| 149 | fontSize = FP; |
| 150 | } else tft->setTextSize(FM); |
| 151 | tft->setCursor((cursor_x - fontSize * LW), cursor_y); |
| 152 | tft->setTextColor(FGCOLOR, BGCOLOR); |
| 153 | tft->print(" "); |
| 154 | tft->setTextColor(getComplementaryColor(BGCOLOR), 0x5AAB); |
| 155 | tft->setCursor(cursor_x - fontSize * LW, cursor_y); |
| 156 | cursor_x = tft->getCursorX(); |
| 157 | cursor_y = tft->getCursorY(); |
| 158 | return true; |
| 159 | } |
| 160 | |
| 161 | /// Handles adding a character to the text string |
| 162 | bool handleCharacterAdd( |
no test coverage detected