Tables, Dpi: added dummy g.DpiScale storage (to be altered in docking), using to scale tables border hit thickness.

+ Added note about how equivalent resize padding for windows (sourced from WINDOWS_HOVER_PADDING) would need further rework.
This commit is contained in:
ocornut
2024-05-14 14:34:52 +02:00
parent f0912833ba
commit f806c76e97
3 changed files with 12 additions and 7 deletions

View File

@@ -3811,6 +3811,7 @@ static void SetCurrentWindow(ImGuiWindow* window)
ImGuiContext& g = *GImGui;
g.CurrentWindow = window;
g.CurrentTable = window && window->DC.CurrentTableIdx != -1 ? g.Tables.GetByIndex(window->DC.CurrentTableIdx) : NULL;
g.DpiScale = 1.0f; // FIXME-DPI: WIP this is modified in docking
if (window)
{
g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize();
@@ -4477,6 +4478,9 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
{
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
// FIXME-DPI: This storage was added on 2021/03/31 for test engine, but if we want to multiply WINDOWS_HOVER_PADDING
// by DpiScale, we need to make this window-agnostic anyhow, maybe need storing inside ImGuiWindow.
g.WindowsHoverPadding = ImMax(g.Style.TouchExtraPadding, ImVec2(WINDOWS_HOVER_PADDING, WINDOWS_HOVER_PADDING));
// Find the window hovered by mouse: