mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 03:47:00 +00:00
Initialised window->Accessed in constructor. Begin() return false with Alpha==0.0
This commit is contained in:
parent
76a39ad224
commit
d6f6afabb3
10
imgui.cpp
10
imgui.cpp
@ -669,9 +669,9 @@ struct ImGuiWindow
|
|||||||
float ScrollY;
|
float ScrollY;
|
||||||
float NextScrollY;
|
float NextScrollY;
|
||||||
bool ScrollbarY;
|
bool ScrollbarY;
|
||||||
bool Visible;
|
bool Visible; // Set to true on Begin()
|
||||||
|
bool Accessed; // Set to true when any widget access the current window
|
||||||
bool Collapsed;
|
bool Collapsed;
|
||||||
bool Accessed;
|
|
||||||
int AutoFitFrames;
|
int AutoFitFrames;
|
||||||
|
|
||||||
ImGuiDrawContext DC;
|
ImGuiDrawContext DC;
|
||||||
@ -924,6 +924,7 @@ ImGuiWindow::ImGuiWindow(const char* name, ImVec2 default_pos, ImVec2 default_si
|
|||||||
NextScrollY = 0.0f;
|
NextScrollY = 0.0f;
|
||||||
ScrollbarY = false;
|
ScrollbarY = false;
|
||||||
Visible = false;
|
Visible = false;
|
||||||
|
Accessed = false;
|
||||||
Collapsed = false;
|
Collapsed = false;
|
||||||
AutoFitFrames = -1;
|
AutoFitFrames = -1;
|
||||||
LastFrameDrawn = -1;
|
LastFrameDrawn = -1;
|
||||||
@ -2177,13 +2178,14 @@ bool Begin(const char* name, bool* open, ImVec2 size, float fill_alpha, ImGuiWin
|
|||||||
|
|
||||||
// We also hide the window from rendering because we've already added its border to the command list.
|
// We also hide the window from rendering because we've already added its border to the command list.
|
||||||
// (we could perform the check earlier in the function but it is simplier at this point)
|
// (we could perform the check earlier in the function but it is simplier at this point)
|
||||||
// FIXME-WIP
|
|
||||||
if (window->Collapsed)
|
if (window->Collapsed)
|
||||||
window->Visible = false;
|
window->Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return collapsed so that user can perform an early out optimisation
|
// Return collapsed so that user can perform an early out optimisation
|
||||||
return !window->Collapsed;
|
const bool hidden = g.Style.Alpha <= 0.0f;
|
||||||
|
const bool collapsed = window->Collapsed;
|
||||||
|
return hidden || !collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void End()
|
void End()
|
||||||
|
Loading…
Reference in New Issue
Block a user