| 3700 | static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f; |
| 3701 | |
| 3702 | static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index) |
| 3703 | { |
| 3704 | // Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing |
| 3705 | // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning. |
| 3706 | ImGuiContext& g = *GImGui; |
| 3707 | ImGuiWindow* window = g.CurrentWindow; |
| 3708 | IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. |
| 3709 | IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); |
| 3710 | |
| 3711 | float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x; |
| 3712 | x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); |
| 3713 | if ((columns->Flags & ImGuiOldColumnFlags_NoPreserveWidths)) |
| 3714 | x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); |
| 3715 | |
| 3716 | return x; |
| 3717 | } |
| 3718 | |
| 3719 | float ImGui::GetColumnOffset(int column_index) |
| 3720 | { |
no test coverage detected