Skip to content

Commit

Permalink
Fix minimap resizing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 4, 2023
1 parent ddfe34c commit b3968c8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ls_UI/modules/minimap/minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local unpack = _G.unpack
-- Mine
local isInit = false

local cluster_proto = {}
local minimap_proto = {}

do
Expand Down Expand Up @@ -115,7 +116,7 @@ do
GetMinimapShape = theBodyIsSquare
end

MinimapCluster:SetSize(info[3] + 24, info[3] + 24)
MinimapCluster:SetSize(info[3] + 24, info[3] + 24, true)
E.Movers:Get(MinimapCluster):UpdateSize()

self:SetSize(info[3] - 22, info[3] - 22)
Expand Down Expand Up @@ -164,6 +165,15 @@ do
self.DifficultyFlag:Hide()
end
end

function cluster_proto:ResetSize(_, _, shouldIgnore)
if not shouldIgnore then
local scale = self._config.scale
local info = borderInfo[scale] or borderInfo[100]

self:SetSize(info[3] + 24, info[3] + 24, true)
end
end
end

local flag_proto = {
Expand Down Expand Up @@ -290,8 +300,11 @@ function MODULE:Init()
LoadAddOn("Blizzard_TimeManager")
end

Mixin(MinimapCluster, cluster_proto)

MinimapCluster:ClearAllPoints()
MinimapCluster:SetPoint(unpack(C.db.profile.minimap.point))
hooksecurefunc(MinimapCluster, "SetSize", MinimapCluster.ResetSize)
E.Movers:Create(MinimapCluster)

Mixin(Minimap, minimap_proto)
Expand Down

0 comments on commit b3968c8

Please sign in to comment.