| 3754 | static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f; |
| 3755 | |
| 3756 | static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index) |
| 3757 | { |
| 3758 | // Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing |
| 3759 | // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning. |
| 3760 | ImGuiContext& g = *GImGui; |
| 3761 | ImGuiWindow* window = g.CurrentWindow; |
| 3762 | IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. |
| 3763 | IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); |
| 3764 | |
| 3765 | float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x; |
| 3766 | x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); |
| 3767 | if ((columns->Flags & ImGuiOldColumnFlags_NoPreserveWidths)) |
| 3768 | x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); |
| 3769 | |
| 3770 | return x; |
| 3771 | } |
| 3772 | |
| 3773 | float ImGui::GetColumnOffset(int column_index) |
| 3774 | { |
no test coverage detected