|
1 | | -// dear imgui, v1.91.1 WIP |
| 1 | +// dear imgui, v1.91.1 |
2 | 2 | // (internal structures/api) |
3 | 3 |
|
4 | 4 | // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. |
@@ -2088,7 +2088,7 @@ struct ImGuiViewportP : public ImGuiViewport |
2088 | 2088 |
|
2089 | 2089 | // Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect) |
2090 | 2090 | ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const { return ImVec2(Pos.x + inset_min.x, Pos.y + inset_min.y); } |
2091 | | - ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const { return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y + inset_max.y)); } |
| 2091 | + ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const { return ImVec2(ImMax(0.0f, Size.x - inset_min.x - inset_max.x), ImMax(0.0f, Size.y - inset_min.y - inset_max.y)); } |
2092 | 2092 | void UpdateWorkRect() { WorkPos = CalcWorkRectPos(WorkInsetMin); WorkSize = CalcWorkRectSize(WorkInsetMin, WorkInsetMax); } // Update public fields |
2093 | 2093 |
|
2094 | 2094 | // Helpers to retrieve ImRect (we don't need to store BuildWorkRect as every access tend to change it, hence the code asymmetry) |
@@ -3078,6 +3078,7 @@ struct IMGUI_API ImGuiWindow |
3078 | 3078 | ImGuiID GetID(const char* str, const char* str_end = NULL); |
3079 | 3079 | ImGuiID GetID(const void* ptr); |
3080 | 3080 | ImGuiID GetID(int n); |
| 3081 | + ImGuiID GetIDFromPos(const ImVec2& p_abs); |
3081 | 3082 | ImGuiID GetIDFromRectangle(const ImRect& r_abs); |
3082 | 3083 |
|
3083 | 3084 | // We don't use g.FontSize because the window may be != g.CurrentWindow. |
@@ -3191,6 +3192,7 @@ struct ImGuiTableColumn |
3191 | 3192 | float MaxX; |
3192 | 3193 | float WidthRequest; // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout() |
3193 | 3194 | float WidthAuto; // Automatic width |
| 3195 | + float WidthMax; // Maximum width (FIXME: overwritten by each instance) |
3194 | 3196 | float StretchWeight; // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially. |
3195 | 3197 | float InitStretchWeightOrWidth; // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_). |
3196 | 3198 | ImRect ClipRect; // Clipping rectangle for the column |
@@ -3492,8 +3494,8 @@ namespace ImGui |
3492 | 3494 | inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window) { window->ParentWindowForFocusRoute = parent_window; } // You may also use SetNextWindowClass()'s FocusRouteParentWindowId field. |
3493 | 3495 | inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); } |
3494 | 3496 | inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); } |
3495 | | - inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); } |
3496 | 3497 | inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x - off.x, p.y - off.y); } |
| 3498 | + inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p) { ImVec2 off = window->DC.CursorStartPos; return ImVec2(p.x + off.x, p.y + off.y); } |
3497 | 3499 |
|
3498 | 3500 | // Windows: Display Order and Focus Order |
3499 | 3501 | IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0); |
@@ -3897,7 +3899,7 @@ namespace ImGui |
3897 | 3899 | IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n); |
3898 | 3900 | IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n); |
3899 | 3901 | IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0); |
3900 | | - IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n); |
| 3902 | + IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n); |
3901 | 3903 | IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n); |
3902 | 3904 | IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table); |
3903 | 3905 | IMGUI_API void TableRemove(ImGuiTable* table); |
|
0 commit comments