MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / MoveCaretInsideView

Method MoveCaretInsideView

scintilla/src/Editor.cxx:1229–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227}
1228
1229void Editor::MoveCaretInsideView ( bool ensureVisible )
1230{
1231 PRectangle rcClient = GetTextRectangle();
1232 Point pt = PointMainCaret();
1233 if ( pt.y < rcClient.top ) {
1234 MovePositionTo ( SPositionFromLocation (
1235 Point ( lastXChosen - xOffset, rcClient.top ),
1236 false, false, UserVirtualSpace() ),
1237 Selection::noSel, ensureVisible );
1238 } else if ( ( pt.y + vs.lineHeight - 1 ) > rcClient.bottom ) {
1239 int yOfLastLineFullyDisplayed = rcClient.top + ( LinesOnScreen() - 1 ) * vs.lineHeight;
1240 MovePositionTo ( SPositionFromLocation (
1241 Point ( lastXChosen - xOffset, rcClient.top + yOfLastLineFullyDisplayed ),
1242 false, false, UserVirtualSpace() ),
1243 Selection::noSel, ensureVisible );
1244 }
1245}
1246
1247int Editor::DisplayFromPosition ( int pos )
1248{

Callers

nothing calls this directly

Calls 1

PointClass · 0.85

Tested by

no test coverage detected