From ad54ac5a840c4a31e117fdedd6932ec450441ccc Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 12 May 2016 11:09:03 +0200 Subject: Fix building with -qreal float Min and max expressions need matching types, which means we have to take care both values are qreal. Task-number: QTCREATORBUG-15851 Change-Id: I5f123e979fa896006ff6eafaac1f65b667db975d Reviewed-by: Marc Mutz --- src/gui/painting/qpainter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting/qpainter.cpp') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 62254213f3..1acd84754a 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6268,7 +6268,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const pen.setColor(uc); // Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms - const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / 2.), pen); + const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / qreal(2.)), pen); const int descent = qFloor(maxHeight); painter->setBrushOrigin(painter->brushOrigin().x(), 0); @@ -6279,7 +6279,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const // the text above it, but limit it to stay within descent. qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5; if (underlineOffset <= fe->descent().toReal()) - adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - 0.5); + adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - qreal(0.5)); const qreal underlinePos = pos.y() + adjustedUnderlineOffset; QColor uc = charFormat.underlineColor(); if (uc.isValid()) -- cgit v1.2.3