Skip to content

Commit

Permalink
Fix cursor movement
Browse files Browse the repository at this point in the history
  • Loading branch information
hexagonrecursion committed Dec 24, 2024
1 parent 8a40853 commit 0886c02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions colobot-base/src/ui/controls/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2450,15 +2450,15 @@ void CEdit::MoveLine(int move, bool bWord, bool bSelect)
{
c = m_engine->GetText()->Detect(std::string(m_text.data()+m_lineOffset[line]),
m_fontType, m_fontSize,
m_lineOffset[line+1]-m_lineOffset[line]);
column);
}
else
{
c = m_engine->GetText()->Detect(std::string(m_text.data()+m_lineOffset[line]),
m_format.begin() + m_lineOffset[line],
m_format.end(),
m_fontSize,
m_lineOffset[line+1]-m_lineOffset[line]);
column);
}

m_cursor1 = m_lineOffset[line]+c;
Expand All @@ -2480,13 +2480,13 @@ void CEdit::ColumnFix()
if ( m_format.empty() )
{
m_column = m_engine->GetText()->GetStringWidth(
std::string(m_text.data()+m_lineOffset[line]),
std::string(m_text.data()+m_lineOffset[line], m_cursor1-m_lineOffset[line]),
m_fontType, m_fontSize);
}
else
{
m_column = m_engine->GetText()->GetStringWidth(
std::string(m_text.data()+m_lineOffset[line]),
std::string(m_text.data()+m_lineOffset[line], m_cursor1-m_lineOffset[line]),
m_format.begin() + m_lineOffset[line],
m_format.end(),
m_fontSize
Expand Down

0 comments on commit 0886c02

Please sign in to comment.