Minor tweaks/comments. Note that the reordering the one subtraction caused subtle havoc before the patch in 9ac8820ee2.

This commit is contained in:
omar 2017-11-08 22:36:31 +01:00
parent 9ac8820ee2
commit a4cc3d4637

View File

@ -4404,7 +4404,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
else if (held) else if (held)
{ {
// We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position // We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position
size_target = (g.IO.MousePos - g.ActiveIdClickOffset + resize_rect.GetSize()) - window->Pos; size_target = (g.IO.MousePos - g.ActiveIdClickOffset - window->Pos) + resize_rect.GetSize();
} }
if (size_target.x != FLT_MAX && size_target.y != FLT_MAX) if (size_target.x != FLT_MAX && size_target.y != FLT_MAX)
@ -10456,8 +10456,8 @@ void ImGui::EndColumns()
{ {
float x = window->Pos.x + GetColumnOffset(i); float x = window->Pos.x + GetColumnOffset(i);
const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(i); const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(i);
const float column_w = 4.0f; // Width for interaction const float column_hw = 4.0f; // Half-width for interaction
const ImRect column_rect(ImVec2(x - column_w, y1), ImVec2(x + column_w, y2)); const ImRect column_rect(ImVec2(x - column_hw, y1), ImVec2(x + column_hw, y2));
if (IsClippedEx(column_rect, column_id, false)) if (IsClippedEx(column_rect, column_id, false))
continue; continue;
@ -10468,7 +10468,7 @@ void ImGui::EndColumns()
if (hovered || held) if (hovered || held)
g.MouseCursor = ImGuiMouseCursor_ResizeEW; g.MouseCursor = ImGuiMouseCursor_ResizeEW;
if (held && g.ActiveIdIsJustActivated) if (held && g.ActiveIdIsJustActivated)
g.ActiveIdClickOffset.x -= column_w; // Store from center of column line (we used a 8 wide rect for columns clicking). This is used by GetDraggedColumnOffset(). g.ActiveIdClickOffset.x -= column_hw; // Store from center of column line (we used a 8 wide rect for columns clicking). This is used by GetDraggedColumnOffset().
if (held) if (held)
dragging_column = i; dragging_column = i;
} }