@@ -21,7 +21,6 @@ local unpack = unpack
2121local CreateFrame = CreateFrame
2222local InCombatLockdown = InCombatLockdown
2323local RegisterStateDriver = RegisterStateDriver
24- local RunNextFrame = RunNextFrame
2524local UnregisterStateDriver = UnregisterStateDriver
2625
2726local C_AddOns_IsAddOnLoaded = C_AddOns .IsAddOnLoaded
@@ -143,22 +142,24 @@ function MB:HandleLibDBIconButton(button, name)
143142
144143 self :SecureHook (button , " SetShown" , " OnButtonSetShown" )
145144
146- if button .icon and not self :IsHooked (button .icon , " SetTexCoord" ) then
147- self :SecureHook (button .icon , " SetTexCoord" , function (_ , ...)
145+ if button .icon and button . icon . SetTexCoord and not self :IsHooked (button .icon , " SetTexCoord" ) then
146+ self :RawHook (button .icon , " SetTexCoord" , function (icon , ...)
148147 local arg1 , arg2 , arg3 , arg4 = ...
149148 if
150149 F .IsAlmost (arg1 , 0.05 )
151150 and F .IsAlmost (arg2 , 0.95 )
152151 and F .IsAlmost (arg3 , 0.05 )
153152 and F .IsAlmost (arg4 , 0.95 )
154153 then
155- button . icon : SetTexCoord (unpack (E .TexCoords ))
154+ return self . hooks [ icon ]. SetTexCoord (icon , unpack (E .TexCoords ))
156155 end
157156
158157 if F .IsAlmost (arg1 , 0 ) and F .IsAlmost (arg2 , 1 ) and F .IsAlmost (arg3 , 0 ) and F .IsAlmost (arg4 , 1 ) then
159- button . icon : SetTexCoord (unpack (E .TexCoords ))
158+ return self . hooks [ icon ]. SetTexCoord (icon , unpack (E .TexCoords ))
160159 end
161- end )
160+
161+ return self .hooks [icon ].SetTexCoord (icon , ... )
162+ end , true )
162163 end
163164
164165 return button :IsShown ()
0 commit comments