forked from qt-creator/qt-creator
TextEditor: Fix High-DPI+Qt6 drawing of the refactor marker icon
Subtle devicePixelRatio-related changes in Qt require to restrict one division by a Qt 5 specific #ifdef. Fixes: QTCREATORBUG-26905 Change-Id: Ic5eecef5c7cb355abc8a5391708c5cd1050af282 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -87,7 +87,10 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte
|
||||
const QSize proposedIconSize =
|
||||
QSize(m_editor->fontMetrics().horizontalAdvance(QLatin1Char(' ')) + 3,
|
||||
cursorRect.height()) * devicePixelRatio;
|
||||
const QSize actualIconSize = icon.actualSize(proposedIconSize) / devicePixelRatio;
|
||||
QSize actualIconSize = icon.actualSize(proposedIconSize);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
actualIconSize /= devicePixelRatio;
|
||||
#endif // Qt < 6.0
|
||||
|
||||
const int y = cursorRect.top() + ((cursorRect.height() - actualIconSize.height()) / 2);
|
||||
const int x = cursorRect.right();
|
||||
|
Reference in New Issue
Block a user