BeginTooltip: correctly testing return value of BeginTooltipEx() even though it always return true in current code.

Amend 3b2f617
This commit is contained in:
ocornut 2023-03-14 14:28:41 +01:00
parent c426e32247
commit 552969e33e
2 changed files with 4 additions and 2 deletions

View File

@ -9942,7 +9942,8 @@ void ImGui::EndTooltip()
void ImGui::SetTooltipV(const char* fmt, va_list args)
{
BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None))
return;
TextV(fmt, args);
EndTooltip();
}

View File

@ -5759,7 +5759,8 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags
{
ImGuiContext& g = *GImGui;
BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
if (!BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None))
return;
const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text;
if (text_end > text)
{