From a1d4545e29dd8edc8ae6347cdf528974b0a5b4aa Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 23 Dec 2024 01:00:41 +0100 Subject: [PATCH] fix: Don't allow negative regions in region widgets --- plugins/ui/include/ui/widgets.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ui/include/ui/widgets.hpp b/plugins/ui/include/ui/widgets.hpp index 93f8ce1e7..2623724a1 100644 --- a/plugins/ui/include/ui/widgets.hpp +++ b/plugins/ui/include/ui/widgets.hpp @@ -43,6 +43,9 @@ namespace hex::ui { const auto width = ImGui::GetContentRegionAvail().x / 2 - ImGui::CalcTextSize(" - ").x / 2; u64 start = region->getStartAddress(), end = region->getEndAddress(); + if (end < start) + end = start; + ImGui::PushItemWidth(width); ImGuiExt::InputHexadecimal("##start", &start); ImGui::PopItemWidth();