MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / GetTableRect

Method GetTableRect

imgui_tiny_app/imgui/imgui.cpp:22342–22360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22340 struct Funcs
22341 {
22342 static ImRect GetTableRect(ImGuiTable* table, int rect_type, int n)
22343 {
22344 ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); // Always using last submitted instance
22345 if (rect_type == TRT_OuterRect) { return table->OuterRect; }
22346 else if (rect_type == TRT_InnerRect) { return table->InnerRect; }
22347 else if (rect_type == TRT_WorkRect) { return table->WorkRect; }
22348 else if (rect_type == TRT_HostClipRect) { return table->HostClipRect; }
22349 else if (rect_type == TRT_InnerClipRect) { return table->InnerClipRect; }
22350 else if (rect_type == TRT_BackgroundClipRect) { return table->BgClipRect; }
22351 else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); }
22352 else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); }
22353 else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; }
22354 else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); } // Note: y1/y2 not always accurate
22355 else if (rect_type == TRT_ColumnsContentHeadersIdeal){ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersIdeal, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); }
22356 else if (rect_type == TRT_ColumnsContentFrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXFrozen, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight); }
22357 else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table_instance->LastFrozenHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); }
22358 IM_ASSERT(0);
22359 return ImRect();
22360 }
22361
22362 static ImRect GetWindowRect(ImGuiWindow* window, int rect_type)
22363 {

Callers

nothing calls this directly

Calls 2

TableGetInstanceDataFunction · 0.85
ImRectFunction · 0.70

Tested by

no test coverage detected