MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / ClampLegendRect

Function ClampLegendRect

Source/3rdParty/implot/implot.cpp:635–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2& pad) {
636 bool clamped = false;
637 ImRect outer_rect_pad(outer_rect.Min + pad, outer_rect.Max - pad);
638 if (legend_rect.Min.x < outer_rect_pad.Min.x) {
639 legend_rect.Min.x = outer_rect_pad.Min.x;
640 clamped = true;
641 }
642 if (legend_rect.Min.y < outer_rect_pad.Min.y) {
643 legend_rect.Min.y = outer_rect_pad.Min.y;
644 clamped = true;
645 }
646 if (legend_rect.Max.x > outer_rect_pad.Max.x) {
647 legend_rect.Max.x = outer_rect_pad.Max.x;
648 clamped = true;
649 }
650 if (legend_rect.Max.y > outer_rect_pad.Max.y) {
651 legend_rect.Max.y = outer_rect_pad.Max.y;
652 clamped = true;
653 }
654 return clamped;
655}
656
657int LegendSortingComp(const void* _a, const void* _b) {
658 ImPlotItemGroup* items = GImPlot->SortItems;

Callers 2

EndPlotFunction · 0.85
EndSubplotsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected