Skip to content

Commit

Permalink
fix: Assert when selecting selectable text
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 18, 2025
1 parent 117eb1e commit 41c8be2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/libimhex/include/hex/ui/imgui_imhex_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace ImGuiExt {
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4());

ImGui::PushItemWidth(ImGui::CalcTextSize(text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2);
ImGui::InputText("##", const_cast<char *>(text.c_str()), text.size(), ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_NoHorizontalScroll);
ImGui::InputText("##", const_cast<char *>(text.c_str()), text.size() + 1, ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_NoHorizontalScroll);
ImGui::PopItemWidth();

ImGui::PopStyleColor();
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace ImGuiExt {
ImGui::InputTextMultiline(
"##",
const_cast<char *>(text.c_str()),
text.size(),
text.size() + 1,
ImVec2(0, textSize.y),
ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_NoHorizontalScroll
);
Expand Down

0 comments on commit 41c8be2

Please sign in to comment.