MCPcopy Create free account
hub / github.com/WheretIB/nullc / ClampCursorBounds

Method ClampCursorBounds

GUI/RichTextarea.cpp:1522–1533  ·  view source on GitHub ↗

Function checks if the cursor is placed on a valid position, and if not, moves it

Source from the content-addressed store, hash-verified

1520
1521// Function checks if the cursor is placed on a valid position, and if not, moves it
1522void 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
1536void TextareaData::DeleteSelection()

Callers 1

ScrollToLineMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected