Fix active square going out of bounds. - crossword.koplugin - Unnamed repository; edit this file 'description' to name the repository. (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules (DIR) README (DIR) LICENSE --- (DIR) commit 3a9857aa184c50b53b37f4b2735a583822ef9394 (DIR) parent 9e705bde86fcb1ee4442cb39ac0df00455e00ed2 (HTM) Author: Scarlett <social@scarlettmcallister.com> Date: Wed, 5 Jan 2022 16:43:28 -0400 Fix active square going out of bounds. Diffstat: M gameview.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- (DIR) diff --git a/gameview.lua b/gameview.lua @@ -146,9 +146,14 @@ end function GameView:advancePointer() if self.active_direction == Solve.DOWN then - self.active_row_num = self.active_row_num + 1 + if self.active_row_num >= self.puzzle.size.rows then + self.active_row_num = 1 + self.active_col_num = self.active_col_num + 1 + else + self.active_row_num = self.active_row_num + 1 + end elseif self.active_direction == Solve.ACROSS then - if (self.active_col_num) >= self.puzzle.size.cols then + if self.active_col_num >= self.puzzle.size.cols then self.active_col_num = 1 self.active_row_num = self.active_row_num + 1 else