From 1db882ed1b0179bf4bc24ead1ccf0231f07a678b Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Thu, 19 Nov 2020 19:34:54 -0500 Subject: [PATCH] Partially revert 876b87b64e0f6a3519ea3e3d58f28ab81a480cae This broke all text objects (for me on Windows at least) --- common/gal/stroke_font.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 9b6cbec93a..e287de2438 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -332,9 +332,6 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) bool in_super_or_subscript = false; VECTOR2D glyphSize = baseGlyphSize; - // Allocate only once (for performance) - std::deque ptListScaled; - yOffset = 0; for( UTF8::uni_iter chIt = aText.ubegin(), end = aText.uend(); chIt < end; ++chIt ) @@ -459,8 +456,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) for( const std::vector* ptList : *glyph ) { - int ptCount = 0; - ptListScaled.clear(); + std::deque ptListScaled; for( const VECTOR2D& pt : *ptList ) { @@ -477,10 +473,9 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) } ptListScaled.push_back( scaledPt ); - ptCount++; } - m_gal->DrawPolyline( &ptListScaled[0], ptCount ); + m_gal->DrawPolyline( ptListScaled ); } xOffset += glyphSize.x * bbox.GetEnd().x;