1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: Crash when making pattern editor window too small

This commit is contained in:
WerWolv 2023-12-08 11:15:32 +01:00
parent ef25542220
commit 411884966b

View File

@ -164,7 +164,7 @@ namespace hex::plugin::builtin {
textEditorSize.y += height;
if (availableSize.y > 1)
textEditorSize.y = std::clamp(textEditorSize.y, 1.0F, availableSize.y - ImGui::GetTextLineHeightWithSpacing() * 3);
textEditorSize.y = std::clamp(textEditorSize.y, 1.0F, std::max(1.0F, availableSize.y - ImGui::GetTextLineHeightWithSpacing() * 3));
this->m_textEditor.Render("hex.builtin.view.pattern_editor.name"_lang, textEditorSize, true);