Skip to content

Commit 872c2db

Browse files
committed
fix: resize m_shapes to its capacity
- should fix out-of-bounds detection issue with msvc - reset previous m_shapes
1 parent a326c78 commit 872c2db

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/alfons/textShaper.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,8 @@ bool TextShaper::shape(std::shared_ptr<Font>& _font, const TextLine& _line,
384384

385385
for (const TextRun& run : _range) {
386386
size_t length = run.end - run.start;
387-
if (length >= m_shapes.capacity()) {
388-
m_shapes.resize(length + 16);
389-
m_glyphAdded.resize(m_shapes.capacity());
390-
m_linebreaks.reserve(m_shapes.capacity());
391-
}
392387

388+
m_shapes.assign(length, {});
393389
m_glyphAdded.assign(length, 0);
394390

395391
bool missingGlyphs = true;

0 commit comments

Comments
 (0)