Skip to content

Commit

Permalink
CellItem: Render only opened cells
Browse files Browse the repository at this point in the history
Closes #15.
  • Loading branch information
Kaffeine committed Jan 28, 2020
1 parent c6ba601 commit 47ed832
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CellItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ void CellItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,

painter->drawRect(0, 0, cellSize, cellSize);

if (m_cell->haveMine()) {
m_text->setText("+");
} else if (m_cell->minesAround() > 0) {
m_text->setText(QString::number(m_cell->minesAround()));
if (m_cell->isOpen()) {
if (m_cell->haveMine()) {
m_text->setText("+");
} else if (m_cell->minesAround() > 0) {
m_text->setText(QString::number(m_cell->minesAround()));
}
}
}

Expand Down

0 comments on commit 47ed832

Please sign in to comment.