Browse Source

* Fixed obsucre crash when bar width is equal to max width.

Nikolaos Patsiouras 6 years ago
parent
commit
28f4f99afe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/common/example-glue.cpp

+ 1 - 1
examples/common/example-glue.cpp

@@ -84,7 +84,7 @@ static bool bar(float _width, float _maxWidth, float _height, const ImVec4& _col
 	itemHovered |= ImGui::IsItemHovered();
 	itemHovered |= ImGui::IsItemHovered();
 
 
 	ImGui::SameLine();
 	ImGui::SameLine();
-	ImGui::InvisibleButton("", ImVec2(_maxWidth-_width, _height) );
+	ImGui::InvisibleButton("", ImVec2(bx::max(1.0f, _maxWidth-_width), _height) );
 	itemHovered |= ImGui::IsItemHovered();
 	itemHovered |= ImGui::IsItemHovered();
 
 
 	ImGui::PopStyleVar(2);
 	ImGui::PopStyleVar(2);