mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 21:59:02 +08:00
Minor tweaks/comments. Note that the reordering the one subtraction caused subtle havoc before the patch in 9ac8820ee2
.
This commit is contained in:
parent
9ac8820ee2
commit
a4cc3d4637
@ -4404,7 +4404,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
else if (held)
|
||||
{
|
||||
// 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)
|
||||
@ -10456,8 +10456,8 @@ void ImGui::EndColumns()
|
||||
{
|
||||
float x = window->Pos.x + GetColumnOffset(i);
|
||||
const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(i);
|
||||
const float column_w = 4.0f; // Width for interaction
|
||||
const ImRect column_rect(ImVec2(x - column_w, y1), ImVec2(x + column_w, y2));
|
||||
const float column_hw = 4.0f; // Half-width for interaction
|
||||
const ImRect column_rect(ImVec2(x - column_hw, y1), ImVec2(x + column_hw, y2));
|
||||
if (IsClippedEx(column_rect, column_id, false))
|
||||
continue;
|
||||
|
||||
@ -10468,7 +10468,7 @@ void ImGui::EndColumns()
|
||||
if (hovered || held)
|
||||
g.MouseCursor = ImGuiMouseCursor_ResizeEW;
|
||||
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)
|
||||
dragging_column = i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user