MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / restoreViewState

Method restoreViewState

src/editor.cpp:697–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695}
696
697void RcxEditor::restoreViewState(const ViewState& vs) {
698 int maxLine = std::max(0, m_sci->lines() - 1);
699 int line = std::clamp(vs.cursorLine, 0, maxLine);
700 long pos = m_sci->SendScintilla(QsciScintillaBase::SCI_FINDCOLUMN,
701 (unsigned long)line,
702 (long)std::max(0, vs.cursorCol));
703 m_sci->SendScintilla(QsciScintillaBase::SCI_GOTOPOS, (unsigned long)pos);
704 m_sci->SendScintilla(QsciScintillaBase::SCI_SETFIRSTVISIBLELINE,
705 (unsigned long)vs.scrollLine);
706 m_sci->SendScintilla(QsciScintillaBase::SCI_SETXOFFSET,
707 (unsigned long)vs.xOffset);
708}
709
710const LineMeta* RcxEditor::metaForLine(int line) const {
711 if (line >= 0 && line < m_meta.size())

Callers 1

refreshMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected