Skip to content

Commit b6a8cf0

Browse files
committed
Fix breakage in dear imgui rc 1.90.9+
1 parent e8f04d8 commit b6a8cf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UImGuiTextUtilsTextMarkdown.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ UImGui::TextUtils::WidgetState UImGui::TextUtils::renderWrappedTextGeneric(const
242242
{
243243
if (isPartOfWord(*endLine))
244244
{
245-
const float nextLineWidth = ImGui::GetContentRegionMax().x;
245+
// Get maximum line width like this because dear imgui rc 1.90.9+ deprecated these
246+
const float nextLineWidth = (ImGui::GetContentRegionAvail() + ImGui::GetCursorScreenPos()).x;
246247
const char* nextLineEnd = ImGui::GetFont()->CalcWordWrapPositionA(scale, text, end, nextLineWidth);
247248
if (nextLineEnd == end || (nextLineEnd <= end && !isPartOfWord(*nextLineEnd)))
248249
endLine = text;

0 commit comments

Comments
 (0)