fix: scaling border

This commit is contained in:
Salikh Gurgenidze
2026-01-05 12:37:26 +04:00
parent 0494a5cde8
commit e36ca87d53
5 changed files with 215 additions and 9 deletions
+31 -3
View File
@@ -74,10 +74,13 @@ function TrackedItemBar:Update()
frame:Show()
self:ScanForTrackedItems()
local buttonSize = 37
local buttonSize = addon.Modules.DB:GetSetting("trackedBarSize") or 36
local spacing = 2
local xOffset = 5
-- Update frame height based on button size
frame:SetHeight(buttonSize + 8)
-- Hide all buttons initially
for _, btn in ipairs(buttons) do
@@ -162,9 +165,34 @@ function TrackedItemBar:Update()
button:ClearAllPoints()
button:SetPoint("LEFT", frame, "LEFT", xOffset + (i-1) * (buttonSize + spacing), 0)
button:SetWidth(buttonSize)
button:SetHeight(buttonSize)
-- Resize all button textures to match button size
local icon = getglobal(button:GetName() .. "IconTexture")
if icon then
icon:SetWidth(buttonSize)
icon:SetHeight(buttonSize)
end
-- Scale border proportionally (64/37 is the standard ratio for WoW item buttons)
local borderSize = buttonSize * 64 / 37
local normalTex = getglobal(button:GetName() .. "NormalTexture")
if normalTex then
normalTex:SetWidth(borderSize)
normalTex:SetHeight(borderSize)
end
-- Resize empty slot background
local emptyBg = getglobal(button:GetName() .. "_EmptySlotBg")
if emptyBg then
emptyBg:SetWidth(buttonSize)
emptyBg:SetHeight(buttonSize)
end
button:Show()
end
local numItems = table.getn(trackedItemsInfo)
if numItems > 0 then
local newWidth = xOffset * 2 + numItems * (buttonSize + spacing) - spacing