Skip to content

Commit

Permalink
Merge pull request #152 from jpd236/annotation-crashes
Browse files Browse the repository at this point in the history
Fix more issues with navigating through grids with annotation squares.
  • Loading branch information
mrichards42 authored Jun 6, 2021
2 parents 705706c + 4d1f01a commit 9e253dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/XGridCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ XGridCtrl::OnLetter(wxChar key, int mod)

// Space bar always moves forward one square
if (static_cast<int>(key) == WXK_SPACE)
SetFocusedSquare(m_focusedWord->FindNextSquare(m_focusedSquare), m_focusedWord);
SetFocusedSquare(m_focusedWord->FindNextSquare(m_focusedSquare, FIND_WHITE_SQUARE), m_focusedWord);
else
MoveAfterLetter();
}
Expand Down Expand Up @@ -1578,7 +1578,7 @@ XGridCtrl::MoveAfterLetter()
// word. Move to the next letter if it exists
if (newSquare == NULL)
{
newSquare = m_focusedWord->FindNextSquare(m_focusedSquare);
newSquare = m_focusedWord->FindNextSquare(m_focusedSquare, FIND_WHITE_SQUARE);
// if newSquare == NULL (possibly again), it's the last square in the word,
// and the focus won't change.
}
Expand Down Expand Up @@ -1696,7 +1696,7 @@ XGridCtrl::OnBackspace(int WXUNUSED(mod))
{
wxASSERT(! IsEmpty());
SetSquareText(*m_focusedSquare, _T(""));
SetFocusedSquare(m_focusedWord->FindPrevSquare(m_focusedSquare),
SetFocusedSquare(m_focusedWord->FindPrevSquare(m_focusedSquare, FIND_WHITE_SQUARE),
m_focusedWord);
}

Expand Down

0 comments on commit 9e253dc

Please sign in to comment.