From 4fb39b6d9ede9c666750150bad719460f0b05d87 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 13 Sep 2021 22:45:41 +0200 Subject: [PATCH] CommonHostInterface: Fix broken word wrap in DrawOSDMessages --- src/frontend-common/common_host_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index d44ffa35f..30da486dd 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -1504,8 +1504,8 @@ void CommonHostInterface::DrawOSDMessages() break; const ImVec2 pos(position_x, position_y); - const ImVec2 text_size( - font->CalcTextSizeA(font->FontSize, max_width, -1.0f, msg.text.c_str(), msg.text.c_str() + msg.text.length())); + const ImVec2 text_size(font->CalcTextSizeA(font->FontSize, std::numeric_limits::max(), max_width, + msg.text.c_str(), msg.text.c_str() + msg.text.length())); const ImVec2 size(text_size.x + padding * 2.0f, text_size.y + padding * 2.0f); const ImVec4 text_rect(pos.x + padding, pos.y + padding, pos.x + size.x - padding, pos.y + size.y - padding);