diff options
author | XU, KE <tarcadia@qq.com> | 2023-08-05 17:36:26 +0800 |
---|---|---|
committer | XU, KE <tarcadia@qq.com> | 2023-08-07 07:29:09 +0000 |
commit | a7c4a88f5700ab6f0f7244fbdb44435ba30833af (patch) | |
tree | ee26c199bad2938689b86a60d918d6ee61c0598c /examples/widgets | |
parent | c4a9c70cab27f2d5a054e6f1fd0769b4211eb2b7 (diff) |
examples: Fix Tetrix line-removing bug
When Tetrix example runs, a full line of blocks will remove itself and
any other lines below. The root cause is the code only removes the
lowest line as it would be the full line but a full line can be at not
only the bottom. And this lead to a continuous full-line-finding and
removes the lowest line again and again until the full line is removed.
This fix introduced a minor fix by changing the index of traversing
through the lines to be moved down. This modification allows removing
a line that is not at the bottom and fixes the bug.
Fixes: PYSIDE-2412
Pick-to: 6.5
Change-Id: I7b23bc82b9baac720152a1d93e242df29b82f768
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/widgets/tetrix/tetrix.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/widgets/widgets/tetrix/tetrix.py b/examples/widgets/widgets/tetrix/tetrix.py index 3accd557a..36cbb3448 100644 --- a/examples/widgets/widgets/tetrix/tetrix.py +++ b/examples/widgets/widgets/tetrix/tetrix.py @@ -283,7 +283,7 @@ class TetrixBoard(QFrame): if line_is_full: num_full_lines += 1 - for k in range(TetrixBoard.board_height - 1): + for k in range(i, TetrixBoard.board_height - 1): for j in range(TetrixBoard.board_width): self.set_shape_at(j, k, self.shape_at(j, k + 1)) |