Viewport: Store current dpi scale in context.

This commit is contained in:
omar
2019-10-29 16:43:11 +01:00
parent 664fb38e39
commit 32380a0112
2 changed files with 5 additions and 2 deletions

View File

@ -1079,6 +1079,7 @@ struct ImGuiContext
// Viewports
ImVector<ImGuiViewportP*> Viewports; // Active viewports (always 1+, and generally 1 unless multi-viewports are enabled). Each viewports hold their copy of ImDrawData.
float CurrentDpiScale; // == CurrentViewport->DpiScale
ImGuiViewportP* CurrentViewport; // We track changes of viewport (happening in Begin) so we can call Platform_OnChangedViewport()
ImGuiViewportP* MouseViewport;
ImGuiViewportP* MouseLastHoveredViewport; // Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag.
@ -1271,6 +1272,7 @@ struct ImGuiContext
LastActiveId = 0;
LastActiveIdTimer = 0.0f;
CurrentDpiScale = 0.0f;
CurrentViewport = NULL;
MouseViewport = MouseLastHoveredViewport = NULL;
PlatformLastFocusedViewport = 0;