Allow specifying all corners for ImGui gradients. (#247)

This commit is contained in:
Skyth (Asilkan)
2025-01-30 23:25:19 +03:00
committed by GitHub
parent 70f042d11f
commit 21c1d36836
6 changed files with 25 additions and 9 deletions

View File

@@ -23,14 +23,21 @@ void InitImGuiUtils()
}
void SetGradient(const ImVec2& min, const ImVec2& max, ImU32 top, ImU32 bottom)
{
SetGradient(min, max, top, top, bottom, bottom);
}
void SetGradient(const ImVec2& min, const ImVec2& max, ImU32 topLeft, ImU32 topRight, ImU32 bottomRight, ImU32 bottomLeft)
{
auto callbackData = AddImGuiCallback(ImGuiCallback::SetGradient);
callbackData->setGradient.boundsMin[0] = min.x;
callbackData->setGradient.boundsMin[1] = min.y;
callbackData->setGradient.boundsMax[0] = max.x;
callbackData->setGradient.boundsMax[1] = max.y;
callbackData->setGradient.gradientTop = top;
callbackData->setGradient.gradientBottom = bottom;
callbackData->setGradient.gradientTopLeft = topLeft;
callbackData->setGradient.gradientTopRight = topRight;
callbackData->setGradient.gradientBottomRight = bottomRight;
callbackData->setGradient.gradientBottomLeft = bottomLeft;
}
void ResetGradient()