DrawList: fixed using ImDrawFlags_UseTexForRoundCorners when ImFontAtlasFlags_NoBakedRoundCorners has also been set.

This commit is contained in:
ocornut
2026-07-30 14:48:28 +02:00
parent ca9305e304
commit 4fa220d168
4 changed files with 11 additions and 9 deletions

View File

@@ -10476,7 +10476,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
//ImGui::CheckboxFlags("UseTexForRoundCorners", &prim_other_flags, ImDrawFlags_UseTexForRoundCorners); ImGui::SameLine();
//ImGui::CheckboxFlags("UseTexForStrokeLegacy", &prim_other_flags, ImDrawFlags_UseTexForStrokeLegacy);
static ImDrawFlags scope_flags = draw_list->Flags; // First init copy current state.
static ImDrawFlags scope_flags = draw_list->Flags & ImDrawFlags_AllowInPushScope_; // First init copy current state.
ImGui::SeparatorText("Current ImDrawList flags (e.g. PushDrawFlag function)");
ImGui::PushID("ScopeFlags");
ImGui::CheckboxFlags("AAFill", &scope_flags, ImDrawFlags_AAFill); ImGui::SameLine();
@@ -10488,7 +10488,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
ImGui::PopID();
ImGui::Spacing();
draw_list->PushDrawFlag(ImDrawFlags_AllowedInScope_, false); // Reset all existing (very unusual: done for this demo)
draw_list->PushDrawFlag(ImDrawFlags_AllowInPushScope_, false); // Reset all existing (very unusual: done for this demo)
draw_list->PushDrawFlag(scope_flags, true);
const ImDrawFlags flags = prim_stroke_flags | prim_other_flags;
const ImDrawFlags fill_flags = flags & (ImDrawFlags_AAFill | ImDrawFlags_UseTexForRoundCorners);