Commit e7c98d9a authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix rendering the background when in hidpi

CCBUGS: 443824
parent 22637578
Pipeline #125303 passed with stage
in 38 seconds
......@@ -148,7 +148,13 @@ void Game::updateGraphics()
QPainter painter(&pix);
painter.drawPixmap(QPoint(leftOffset - padding, -padding), boardPix);
}
setBackgroundBrush(pix);
m_backgroundPixmap = pix;
update();
}
void Game::drawBackground(QPainter *painter, const QRectF &/*rect*/)
{
painter->drawPixmap(0, 0, m_backgroundPixmap);
}
void Game::clickDiamond(const QPoint &point)
......
......@@ -50,6 +50,7 @@ Q_SIGNALS:
void pendingAnimationsFinished();
protected:
void timerEvent(QTimerEvent *event) override;
void drawBackground(QPainter *painter, const QRectF &rect) override;
private:
QList<QPoint> findCompletedRows();
void getMoves();
......@@ -62,6 +63,7 @@ private:
KDiamond::GameState *m_gameState;
KGamePopupItem *m_messenger;
QPixmap m_backgroundPixmap;
};
#endif //KDIAMOND_GAME_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment