MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / CalcRoundingFlagsForRectInRect

Method CalcRoundingFlagsForRectInRect

include/imgui/imgui_draw.cpp:6153–6162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6151}
6152
6153ImDrawFlags ImGui::CalcRoundingFlagsForRectInRect(const ImRect& r_in, const ImRect& r_outer, float threshold)
6154{
6155 bool round_l = r_in.Min.x <= r_outer.Min.x + threshold;
6156 bool round_r = r_in.Max.x >= r_outer.Max.x - threshold;
6157 bool round_t = r_in.Min.y <= r_outer.Min.y + threshold;
6158 bool round_b = r_in.Max.y >= r_outer.Max.y - threshold;
6159 return ImDrawFlags_RoundCornersNone
6160 | ((round_t && round_l) ? ImDrawFlags_RoundCornersTopLeft : 0) | ((round_t && round_r) ? ImDrawFlags_RoundCornersTopRight : 0)
6161 | ((round_b && round_l) ? ImDrawFlags_RoundCornersBottomLeft : 0) | ((round_b && round_r) ? ImDrawFlags_RoundCornersBottomRight : 0);
6162}
6163
6164// Helper for ColorPicker4()
6165// NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected