minor refactor

This commit is contained in:
Roy Qu 2024-04-09 22:16:09 +08:00
parent a9295caff2
commit 66e48cbf41
2 changed files with 5 additions and 9 deletions

View File

@ -1334,9 +1334,9 @@ int DocumentLine::glyphWidth(int i)
return calcSegmentInterval(mGlyphStartPositionList, mWidth, i); return calcSegmentInterval(mGlyphStartPositionList, mWidth, i);
} }
int DocumentLine::width(bool forceUpdate) int DocumentLine::width()
{ {
if(mWidth<0 || forceUpdate) if(mWidth<0)
updateWidth(); updateWidth();
return mWidth; return mWidth;
} }

View File

@ -68,17 +68,13 @@ private:
* *
* @return the glyphs count * @return the glyphs count
*/ */
int glyphsCount() const { int glyphsCount() const { return mGlyphStartCharList.length(); }
return mGlyphStartCharList.length();
}
/** /**
* @brief get list of start index of the glyphs in the line text * @brief get list of start index of the glyphs in the line text
* @return start indice of the glyph. * @return start indice of the glyph.
*/ */
const QList<int>& glyphStartCharList() const { const QList<int>& glyphStartCharList() const { return mGlyphStartCharList; }
return mGlyphStartCharList;
}
/** /**
* @brief get list of start position of the glyphs in the line text * @brief get list of start position of the glyphs in the line text
@ -131,7 +127,7 @@ private:
* @brief get the width (pixel) of the line text * @brief get the width (pixel) of the line text
* @return the width (in width) * @return the width (in width)
*/ */
int width(bool forceUpdate=false); int width();
/** /**
* @brief get the state of the syntax highlighter after this line is parsed * @brief get the state of the syntax highlighter after this line is parsed