Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added extraWidth and extraHeight argument for ButtonGlow #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion LibCustomGlow-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,13 @@ end

local ButtonGlowTextures = {["spark"] = true,["innerGlow"] = true,["innerGlowOver"] = true,["outerGlow"] = true,["outerGlowOver"] = true,["ants"] = true}

function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
function lib.ButtonGlow_Start(r,color,frequency,frameLevel,extraWidth,extraHeight)
if not r then
return
end
frameLevel = frameLevel or 8;
extraWidth = extraWidth or 0
extraHeight = extraHeight or 0
local throttle
if frequency and frequency > 0 then
throttle = 0.25/frequency*0.01
Expand All @@ -612,6 +614,8 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
if r._ButtonGlow then
local f = r._ButtonGlow
local width,height = r:GetSize()
width = width + extraWidth
height = height + extraHeight
f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
f:SetSize(width*1.4 , height*1.4)
f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
Expand Down Expand Up @@ -650,6 +654,8 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
end
r._ButtonGlow = f
local width,height = r:GetSize()
width = width + extraWidth
height = height + extraHeight
f:SetParent(r)
f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
f:SetSize(width * 1.4, height * 1.4)
Expand Down