Skip to content

Commit

Permalink
take pixelSize for background height, to not consider exotic high cha…
Browse files Browse the repository at this point in the history
…racters
  • Loading branch information
daschuer committed Sep 19, 2019
1 parent 7c304d1 commit 2fe49ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/waveform/waveformmarklabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ void WaveformMarkLabel::prerender(QPointF bottomLeft, QPixmap icon, QString text
text = fontMetrics.elidedText(text, Qt::ElideRight, availableWidthForText);
pixmapRect.setWidth(widgetWidth);
}
pixmapRect.setHeight(math_max(fontMetrics.height(), icon.height()));
// We take the pixelSize for background height, to not consider exotic
// high characters.
pixmapRect.setHeight(
math_max(font.pixelSize() * 1.2,
static_cast<double>(icon.height())));

// pixmapRect has a top left of (0,0) for rendering to m_pixmap.
// m_areaRect is the same size but shifted to the coordinates of the widget.
Expand Down

0 comments on commit 2fe49ae

Please sign in to comment.