diff --git a/Common/Render/DrawBuffer.cpp b/Common/Render/DrawBuffer.cpp index 63c06f4c98ee..5310dd612b34 100644 --- a/Common/Render/DrawBuffer.cpp +++ b/Common/Render/DrawBuffer.cpp @@ -521,7 +521,6 @@ void DrawBuffer::MeasureTextRect(FontID font_id, std::string_view text, const Bo return; } - std::string toMeasure = std::string(text); int wrap = align & (FLAG_WRAP_TEXT | FLAG_ELLIPSIZE_TEXT); if (wrap) { const AtlasFont *font = fontAtlas_->getFont(font_id); @@ -532,10 +531,12 @@ void DrawBuffer::MeasureTextRect(FontID font_id, std::string_view text, const Bo *h = 0.0f; return; } + std::string toMeasure = std::string(text); AtlasWordWrapper wrapper(*font, fontscalex, toMeasure, bounds.w, wrap); toMeasure = wrapper.Wrapped(); + } else { + MeasureText(font_id, text, w, h); } - MeasureText(font_id, toMeasure, w, h); } void DrawBuffer::DrawTextShadow(FontID font, std::string_view text, float x, float y, Color color, int flags) {