diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-17 14:58:11 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-17 14:58:11 +1100 |
commit | 1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4 (patch) | |
tree | f25f7353ad23c041da607b07b5ddd247214ba90c /src/PositionCache.cxx | |
parent | 7fbe52f835688967a6079582ed8839cb55d0f9ea (diff) | |
download | scintilla-mirror-1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4.tar.gz |
Change Font to an interface and stop using FontID. Fonts are shared and
reference counted using std::shared_ptr. This optimizes memory and reduces
potential for allocation bugs.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 55af2dabb..8665c19be 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -342,7 +342,7 @@ XYPOSITION ScreenLine::TabWidthMinimumPixels() const { } const Font *ScreenLine::FontOfPosition(size_t position) const { - return &ll->bidiData->stylesFonts[start + position]; + return ll->bidiData->stylesFonts[start + position].get(); } XYPOSITION ScreenLine::RepresentationWidth(size_t position) const { @@ -795,7 +795,7 @@ void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, uns probe = probe2; } } - FontAlias fontStyle = vstyle.styles[styleNumber].font; + const Font *fontStyle = vstyle.styles[styleNumber].font.get(); if (len > BreakFinder::lengthStartSubdivision) { // Break up into segments unsigned int startSegment = 0; |