mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-30 20:34:27 +01:00
TileWidget: make sure the font is at least one pixel wide
This commit is contained in:
parent
06aad1b274
commit
25f3bccdd1
1 changed files with 2 additions and 2 deletions
|
@ -139,7 +139,7 @@ void TileWidget::paintEvent(QPaintEvent *iEvent)
|
|||
|
||||
// The font must grow with the square size
|
||||
QFont letterFont = font();
|
||||
letterFont.setPixelSize(squareSize * 2 / 3);
|
||||
letterFont.setPixelSize(std::max(1, squareSize * 2 / 3));
|
||||
|
||||
if (m_state == COORDS)
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ void TileWidget::paintEvent(QPaintEvent *iEvent)
|
|||
|
||||
QFont pointsFont = font();
|
||||
const double pointsCoeff = 8. / 25.;
|
||||
pointsFont.setPixelSize(squareSize * pointsCoeff);
|
||||
pointsFont.setPixelSize(std::max(1., squareSize * pointsCoeff));
|
||||
|
||||
// XXX: Naive implementation: we repaint everything every time
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue