| 633 | } |
| 634 | |
| 635 | bool 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 | |
| 657 | int LegendSortingComp(const void* _a, const void* _b) { |
| 658 | ImPlotItemGroup* items = GImPlot->SortItems; |
no outgoing calls
no test coverage detected