diff options
-rw-r--r-- | Games/Minesweeper/Field.cpp | 10 | ||||
-rw-r--r-- | Games/Minesweeper/main.cpp | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp index 89f93fa716..9ae543bd49 100644 --- a/Games/Minesweeper/Field.cpp +++ b/Games/Minesweeper/Field.cpp @@ -50,17 +50,17 @@ void Field::for_each_neighbor_of(const Square& square, Callback callback) callback(this->square(r - 1, c)); if (c > 0) // Left callback(this->square(r, c - 1)); - if (r < (m_rows - 2)) // Down + if (r < (m_rows - 1)) // Down callback(this->square(r + 1, c)); - if (c < (m_columns - 2)) // Right + if (c < (m_columns - 1)) // Right callback(this->square(r, c + 1)); if (r > 0 && c > 0) // UpLeft callback(this->square(r - 1, c - 1)); - if (r > 0 && c < (m_columns - 2)) // UpRight + if (r > 0 && c < (m_columns - 1)) // UpRight callback(this->square(r - 1, c + 1)); - if (r < (m_rows - 2) && c > 0) // DownLeft + if (r < (m_rows - 1) && c > 0) // DownLeft callback(this->square(r + 1, c - 1)); - if (r < (m_rows - 2) && c < (m_columns - 2)) // DownRight + if (r < (m_rows - 1) && c < (m_columns - 1)) // DownRight callback(this->square(r + 1, c + 1)); } diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp index 3b9dcb790a..4e5c89b7a1 100644 --- a/Games/Minesweeper/main.cpp +++ b/Games/Minesweeper/main.cpp @@ -22,8 +22,6 @@ int main(int argc, char** argv) container->set_preferred_size({ 0, 36 }); container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); auto* face_button = new GButton(container); - face_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); - face_button->set_preferred_size({ 32, 32 }); face_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/minesweeper/face-default.png")); auto* field = new Field(widget); |