ImDrawList: added InitialFringeScale in ImDrawListSharedData. Default to 1.0f.

This is to allow some DPI mods with less changes. Only the initial value in SetupDrawListSharedData() will need change.
This commit is contained in:
ocornut
2025-02-14 21:39:45 +01:00
parent 2860d7ba05
commit 78ec1272e9
4 changed files with 6 additions and 3 deletions

View File

@@ -374,6 +374,7 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
ImDrawListSharedData::ImDrawListSharedData()
{
memset(this, 0, sizeof(*this));
InitialFringeScale = 1.0f;
for (int i = 0; i < IM_ARRAYSIZE(ArcFastVtx); i++)
{
const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(ArcFastVtx);
@@ -433,7 +434,7 @@ void ImDrawList::_ResetForNewFrame()
_Path.resize(0);
_Splitter.Clear();
CmdBuffer.push_back(ImDrawCmd());
_FringeScale = 1.0f;
_FringeScale = _Data->InitialFringeScale;
}
void ImDrawList::_ClearFreeMemory()