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:
@@ -5136,6 +5136,7 @@ static void SetupDrawListSharedData()
|
|||||||
g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
|
g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
|
||||||
if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
|
if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
|
||||||
g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
|
g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
|
||||||
|
g.DrawListSharedData.InitialFringeScale = 1.0f; // FIXME-DPI: Change this for some DPI scaling experiments.
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::NewFrame()
|
void ImGui::NewFrame()
|
||||||
|
|||||||
+2
-1
@@ -374,6 +374,7 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
|
|||||||
ImDrawListSharedData::ImDrawListSharedData()
|
ImDrawListSharedData::ImDrawListSharedData()
|
||||||
{
|
{
|
||||||
memset(this, 0, sizeof(*this));
|
memset(this, 0, sizeof(*this));
|
||||||
|
InitialFringeScale = 1.0f;
|
||||||
for (int i = 0; i < IM_ARRAYSIZE(ArcFastVtx); i++)
|
for (int i = 0; i < IM_ARRAYSIZE(ArcFastVtx); i++)
|
||||||
{
|
{
|
||||||
const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(ArcFastVtx);
|
const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(ArcFastVtx);
|
||||||
@@ -433,7 +434,7 @@ void ImDrawList::_ResetForNewFrame()
|
|||||||
_Path.resize(0);
|
_Path.resize(0);
|
||||||
_Splitter.Clear();
|
_Splitter.Clear();
|
||||||
CmdBuffer.push_back(ImDrawCmd());
|
CmdBuffer.push_back(ImDrawCmd());
|
||||||
_FringeScale = 1.0f;
|
_FringeScale = _Data->InitialFringeScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImDrawList::_ClearFreeMemory()
|
void ImDrawList::_ClearFreeMemory()
|
||||||
|
|||||||
+2
-1
@@ -786,8 +786,9 @@ struct IMGUI_API ImDrawListSharedData
|
|||||||
float FontScale; // Current/default font scale (== FontSize / Font->FontSize)
|
float FontScale; // Current/default font scale (== FontSize / Font->FontSize)
|
||||||
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
|
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo()
|
||||||
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
|
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
|
||||||
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
float InitialFringeScale; // Initial scale to apply to AA fringe
|
||||||
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
|
||||||
|
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
|
||||||
ImVector<ImVec2> TempBuffer; // Temporary write buffer
|
ImVector<ImVec2> TempBuffer; // Temporary write buffer
|
||||||
|
|
||||||
// Lookup tables
|
// Lookup tables
|
||||||
|
|||||||
+1
-1
@@ -913,7 +913,7 @@ ImRect ImGui::GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis)
|
|||||||
const ImRect outer_rect = window->Rect();
|
const ImRect outer_rect = window->Rect();
|
||||||
const ImRect inner_rect = window->InnerRect;
|
const ImRect inner_rect = window->InnerRect;
|
||||||
const float scrollbar_size = window->ScrollbarSizes[axis ^ 1]; // (ScrollbarSizes.x = width of Y scrollbar; ScrollbarSizes.y = height of X scrollbar)
|
const float scrollbar_size = window->ScrollbarSizes[axis ^ 1]; // (ScrollbarSizes.x = width of Y scrollbar; ScrollbarSizes.y = height of X scrollbar)
|
||||||
IM_ASSERT(scrollbar_size > 0.0f);
|
IM_ASSERT(scrollbar_size >= 0.0f);
|
||||||
const float border_size = IM_ROUND(window->WindowBorderSize * 0.5f);
|
const float border_size = IM_ROUND(window->WindowBorderSize * 0.5f);
|
||||||
const float border_top = (window->Flags & ImGuiWindowFlags_MenuBar) ? IM_ROUND(g.Style.FrameBorderSize * 0.5f) : 0.0f;
|
const float border_top = (window->Flags & ImGuiWindowFlags_MenuBar) ? IM_ROUND(g.Style.FrameBorderSize * 0.5f) : 0.0f;
|
||||||
if (axis == ImGuiAxis_X)
|
if (axis == ImGuiAxis_X)
|
||||||
|
|||||||
Reference in New Issue
Block a user