Skip to content

Commit

Permalink
Added padding to IMGUI window in always_on_top mode to fix clipping o…
Browse files Browse the repository at this point in the history
…n some themes and scales
  • Loading branch information
onimitch committed Apr 12, 2024
1 parent d419f54 commit a6089cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,10 @@ end
function ui:render_imgui(delta_time)
self:tick(delta_time)

imgui.SetNextWindowPos({ self._bounds[1], self._bounds[2] }, ImGuiCond_Always)
imgui.SetNextWindowSize({ self._bounds[3], self._bounds[4] }, ImGuiCond_Always)
local window_padding = 10 * self._scale

imgui.SetNextWindowPos({ self._bounds[1] - window_padding, self._bounds[2] - window_padding }, ImGuiCond_Always)
imgui.SetNextWindowSize({ self._bounds[3] + window_padding, self._bounds[4] + window_padding }, ImGuiCond_Always)
imgui.SetNextWindowFocus()

local windowFlags = bit.bor(ImGuiWindowFlags_NoDecoration, ImGuiWindowFlags_NoFocusOnAppearing, ImGuiWindowFlags_NoNav, ImGuiWindowFlags_NoBackground, ImGuiWindowFlags_NoMove)
Expand Down

0 comments on commit a6089cb

Please sign in to comment.