| 7344 | static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f; |
| 7345 | |
| 7346 | static float GetDraggedColumnOffset(ImGuiColumns* columns, int column_index) |
| 7347 | { |
| 7348 | // Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing |
| 7349 | // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning. |
| 7350 | ImGuiContext& g = *GImGui; |
| 7351 | ImGuiWindow* window = g.CurrentWindow; |
| 7352 | IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. |
| 7353 | IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); |
| 7354 | |
| 7355 | float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x; |
| 7356 | x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); |
| 7357 | if ((columns->Flags & ImGuiColumnsFlags_NoPreserveWidths)) |
| 7358 | x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); |
| 7359 | |
| 7360 | return x; |
| 7361 | } |
| 7362 | |
| 7363 | float ImGui::GetColumnOffset(int column_index) |
| 7364 | { |
no test coverage detected