// Override EndChild/ItemSize max extent with our own to enable auto-resize on the X axis when possible
// FIXME-TABLE: This can be improved (e.g. for Fixed columns we don't want to auto AutoFitWidth? or propagate window auto-fit to table?)
if(table->Flags&ImGuiTableFlags_ScrollX)
{
inner_window->DC.CursorMaxPos.x=max_pos_x;// Set contents width for scrolling
outer_window->DC.CursorMaxPos.x=ImMax(backup_outer_max_pos_x,backup_outer_cursor_pos_x+table->ColumnsGivenWidth+inner_window->ScrollbarSizes.x);// For scrolling
inner_window->DC.CursorMaxPos.x=max_pos_x;// For inner scrolling
outer_window->DC.CursorMaxPos.x=ImMax(backup_outer_max_pos_x,backup_outer_cursor_pos_x+table->ColumnsGivenWidth+inner_window->ScrollbarSizes.x);// For outer scrolling
}
else
{
outer_window->DC.CursorMaxPos.x=ImMax(backup_outer_max_pos_x,table->WorkRect.Min.x+outer_width);// For auto-fit
outer_window->DC.CursorPosPrevLine.x=table->WorkRect.Max.x;// For consistent reaction to SameLine() // FIXME: Should be a feature of layout/ItemAdd