Skip to content

Commit

Permalink
Merge pull request #162 from jpd236/shift-arrow-regression
Browse files Browse the repository at this point in the history
Fix regression in shift-arrow behavior on filled words.
  • Loading branch information
mrichards42 authored Aug 18, 2021
2 parents d76109b + 5093ec1 commit e5609e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/XGridCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,8 @@ XGridCtrl::OnArrow(puz::GridDirection arrowDirection, int mod)
else // Shift
{
// If the arrow is in the focused direction, wrap around the grid.
unsigned int options = AreInLine(m_focusedDirection, arrowDirection) ? 0 : puz::NO_WRAP;
bool sameDirection = AreInLine(m_focusedDirection, arrowDirection);
unsigned int options = sameDirection ? 0 : puz::NO_WRAP;
puz::GridDirection focusedDirection =
static_cast<puz::GridDirection>(m_focusedDirection);
// Move to the next white square in the arrow direction that
Expand Down Expand Up @@ -1718,8 +1719,8 @@ XGridCtrl::OnArrow(puz::GridDirection arrowDirection, int mod)
newWord = closestSquareWord;
}
}
// Find the first square in the word
if (newSquare) {
// If the arrow is in the focused direction, find the first square in the word.
if (newSquare && sameDirection) {
if (newWord)
newSquare = newWord->front();
else
Expand Down

0 comments on commit e5609e1

Please sign in to comment.