From 28f4f99afe5b02dbe3ff5ea656c50a5f801f22b6 Mon Sep 17 00:00:00 2001 From: Nikolaos Patsiouras Date: Thu, 25 Apr 2019 22:29:06 +0300 Subject: [PATCH] * Fixed obsucre crash when bar width is equal to max width. --- examples/common/example-glue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/example-glue.cpp b/examples/common/example-glue.cpp index c392ca0c3..ab273eab2 100644 --- a/examples/common/example-glue.cpp +++ b/examples/common/example-glue.cpp @@ -84,7 +84,7 @@ static bool bar(float _width, float _maxWidth, float _height, const ImVec4& _col itemHovered |= ImGui::IsItemHovered(); ImGui::SameLine(); - ImGui::InvisibleButton("", ImVec2(_maxWidth-_width, _height) ); + ImGui::InvisibleButton("", ImVec2(bx::max(1.0f, _maxWidth-_width), _height) ); itemHovered |= ImGui::IsItemHovered(); ImGui::PopStyleVar(2);