mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
Fix faulty ImGui clip rect usage. (#211)
This commit is contained in:
parent
a5db997e5d
commit
a9677084ea
4 changed files with 56 additions and 44 deletions
|
|
@ -2098,8 +2098,9 @@ static void DrawImGui()
|
||||||
ButtonGuide::Draw();
|
ButtonGuide::Draw();
|
||||||
Fader::Draw();
|
Fader::Draw();
|
||||||
|
|
||||||
DrawProfiler();
|
assert(ImGui::GetForegroundDrawList()->_ClipRectStack.Size == 1 && "Some clip rects were not removed from the stack!");
|
||||||
|
|
||||||
|
DrawProfiler();
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
|
|
||||||
auto drawData = ImGui::GetDrawData();
|
auto drawData = ImGui::GetDrawData();
|
||||||
|
|
|
||||||
|
|
@ -580,11 +580,13 @@ static void DrawContentContainer()
|
||||||
|
|
||||||
if (motion < 1.0f)
|
if (motion < 1.0f)
|
||||||
{
|
{
|
||||||
|
drawList->PopClipRect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (g_isClosing)
|
else if (g_isClosing)
|
||||||
{
|
{
|
||||||
AchievementMenu::s_isVisible = false;
|
AchievementMenu::s_isVisible = false;
|
||||||
|
drawList->PopClipRect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,13 @@ static bool DrawContainer(ImVec2 min, ImVec2 max, float cornerRadius = 25)
|
||||||
|
|
||||||
DrawPauseContainer(g_upWindow.get(), min, max, alpha);
|
DrawPauseContainer(g_upWindow.get(), min, max, alpha);
|
||||||
|
|
||||||
|
if (containerMotion >= 1.0f)
|
||||||
|
{
|
||||||
drawList->PushClipRect(min, max);
|
drawList->PushClipRect(min, max);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return containerMotion >= 1.0f;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AchievementOverlay::Init()
|
void AchievementOverlay::Init()
|
||||||
|
|
@ -117,12 +121,8 @@ void AchievementOverlay::Draw()
|
||||||
|
|
||||||
if (DrawContainer(min, max))
|
if (DrawContainer(min, max))
|
||||||
{
|
{
|
||||||
if (g_isClosing)
|
if (!g_isClosing)
|
||||||
{
|
{
|
||||||
s_isVisible = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw achievement icon.
|
// Draw achievement icon.
|
||||||
drawList->AddImage
|
drawList->AddImage
|
||||||
(
|
(
|
||||||
|
|
@ -159,6 +159,11 @@ void AchievementOverlay::Draw()
|
||||||
1.0f, // radius
|
1.0f, // radius
|
||||||
IM_COL32(0, 0, 0, 255) // shadowColour
|
IM_COL32(0, 0, 0, 255) // shadowColour
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_isVisible = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Pop clip rect from DrawContainer.
|
// Pop clip rect from DrawContainer.
|
||||||
drawList->PopClipRect();
|
drawList->PopClipRect();
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,13 @@ bool DrawContainer(float appearTime, ImVec2 centre, ImVec2 max, bool isForegroun
|
||||||
|
|
||||||
DrawPauseContainer(g_upWindow.get(), _min, _max, alpha);
|
DrawPauseContainer(g_upWindow.get(), _min, _max, alpha);
|
||||||
|
|
||||||
|
if (containerMotion >= 1.0f && !g_isClosing)
|
||||||
|
{
|
||||||
drawList->PushClipRect(_min, _max);
|
drawList->PushClipRect(_min, _max);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return containerMotion >= 1.0f && !g_isClosing;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawButton(int rowIndex, float yOffset, float width, float height, std::string& text)
|
void DrawButton(int rowIndex, float yOffset, float width, float height, std::string& text)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue