forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user