TextEditor: remove mark width factor

Needed to optimize painting of different text mark icons in one line.

Change-Id: Ia7f9dd12020e2a21875b3de54b65257f8ea337d9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-04-27 14:34:08 +02:00
parent 91fb0cf123
commit 9eef4bd2f1
5 changed files with 8 additions and 50 deletions

View File

@@ -84,12 +84,11 @@ private:
TextMarkRegistry *m_instance = nullptr;
TextMark::TextMark(const FilePath &fileName, int lineNumber, Id category, double widthFactor)
TextMark::TextMark(const FilePath &fileName, int lineNumber, Id category)
: m_fileName(fileName)
, m_lineNumber(lineNumber)
, m_visible(true)
, m_category(category)
, m_widthFactor(widthFactor)
{
if (!m_fileName.isEmpty())
TextMarkRegistry::add(this);
@@ -200,7 +199,7 @@ TextMark::AnnotationRects TextMark::annotationRects(const QRectF &boundingRect,
rects.iconRect = QRectF(rects.annotationRect.left(), boundingRect.top(),
0, boundingRect.height());
if (drawIcon)
rects.iconRect.setWidth(rects.iconRect.height() * m_widthFactor);
rects.iconRect.setWidth(rects.iconRect.height());
rects.textRect = QRectF(rects.iconRect.right() + margin, boundingRect.top(),
qreal(fm.horizontalAdvance(rects.text)), boundingRect.height());
rects.annotationRect.setRight(rects.textRect.right() + margin);
@@ -263,16 +262,6 @@ void TextMark::setVisible(bool visible)
updateMarker();
}
double TextMark::widthFactor() const
{
return m_widthFactor;
}
void TextMark::setWidthFactor(double factor)
{
m_widthFactor = factor;
}
bool TextMark::isClickable() const
{
return false;