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

Method ExtendSelectionFromPoint

GUI/RichTextarea.cpp:2311–2331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2309}
2310
2311AreaLine* TextareaData::ExtendSelectionFromPoint(unsigned int xPos, unsigned int yPos)
2312{
2313 // Find cursor position
2314 AreaLine *curr = ClientToCursor(xPos, yPos, dragStartX, dragStartY, true);
2315
2316 if(curr->length == 0)
2317 return curr;
2318 // Clamp horizontal position to line length
2319 if(dragStartX >= (int)curr->length && curr->length != 0)
2320 dragStartX = curr->length - 1;
2321 dragEndX = dragStartX;
2322 dragEndY = dragStartY;
2323
2324 dragStartX = AdvanceCursor(curr, dragStartX, true);
2325 dragEndX = AdvanceCursor(curr, dragEndX, false) + 1;
2326
2327 // Selection is active is the length of selected string is not 0
2328 selectionOn = curr->length != 0;
2329
2330 return curr;
2331}
2332
2333void TextareaData::OnRightMouseDown(unsigned int x, unsigned int y)
2334{

Callers

nothing calls this directly

Calls 1

AdvanceCursorFunction · 0.85

Tested by

no test coverage detected