Skip to content

Commit

Permalink
Stop jumping around on height change when on bottom half of the screen
Browse files Browse the repository at this point in the history
  • Loading branch information
kemayo committed Sep 18, 2024
1 parent 195e7bf commit eb1bcfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ function ns:Refresh()
local vignetteids = C_VignetteInfo.GetVignettes()
table.sort(vignetteids, sort_vignette)

-- Goal: have the frame's top-left point still be in the exact same
-- Needed because LibWindow does tricks with the points to keep it
-- in a sensible place (which it will restore when we call save)
local frameMinX, frameMinY, frameWidth, frameHeight = window:GetRect()
local frameMaxX, frameMaxY = frameMinX + frameWidth, frameMinY + frameHeight

window.linePool:ReleaseAll()
-- print("VIGNETTES_UPDATED", #vignetteids)

Expand Down Expand Up @@ -138,6 +144,8 @@ function ns:Refresh()
window:SetBackdropBorderColor(0, 0, 0, 0)
end

window:ClearAllPoints()
window:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", frameMinX, frameMaxY)
window:SetHeight(height)
window:Show()
end
Expand Down

0 comments on commit eb1bcfd

Please sign in to comment.