Function checks if the cursor is placed on a valid position, and if not, moves it
| 1520 | |
| 1521 | // Function checks if the cursor is placed on a valid position, and if not, moves it |
| 1522 | void TextareaData::ClampCursorBounds() |
| 1523 | { |
| 1524 | if(cursorCharY >= lineCount) |
| 1525 | cursorCharY = lineCount - 1; |
| 1526 | // Find selected line |
| 1527 | currLine = firstLine; |
| 1528 | for(unsigned int i = 0; i < cursorCharY; i++) |
| 1529 | currLine = currLine->next; |
| 1530 | // To clamp horizontal position |
| 1531 | if(cursorCharX > currLine->length) |
| 1532 | cursorCharX = currLine->length; |
| 1533 | } |
| 1534 | |
| 1535 | // Remove characters in active selection |
| 1536 | void TextareaData::DeleteSelection() |