View Single Post
11-15-16, 01:14 PM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
I see what are you saying now, what happens if you create your unitbutton like this then?

Lua Code:
  1. self.headers[i]:SetAttribute("style-width", 68)
  2. self.headers[i]:SetAttribute("style-height", 41)
  3. self.headers[i]:SetAttribute("style-scale", 1)
  4.  
  5. self.headers[i]:SetAttribute("initialConfigFunction", [[
  6.     local header = self:GetParent()
  7.  
  8.     self:SetHeight(header:GetAttribute("style-height") * header:GetAttribute("style-scale"))
  9.     self:SetWidth(header:GetAttribute("style-width") * header:GetAttribute("style-scale"))
  10.     --self:SetScale(header:GetAttribute("style-scale"))
  11.  
  12.     header:CallMethod("initialConfigFunction", self:GetName())
  13. ]])

No scale attribute or 1, just setting the width/height multiplied with the scale itself.

Edit:
I think the style-scale attribute is broken too, if you use a simple SetScale on the header that should also get applied on every unit child which will also scale up the unit button's width/height and the offsets will work properly too:

self.headers[i]:SetScale(1)

Last edited by Resike : 11-17-16 at 07:08 PM.