oUF-wow / oUF

WoW AddOn - Unit frame framework.
MIT License
221 stars 58 forks source link

Unit name is shaking at raid groups #666

Closed Nils89 closed 5 months ago

Nils89 commented 8 months ago

Describe the bug At the raid grid oUF setup the name is shaking, but only on group 5

How to reproduce be in a raid

What did you expect? No Shaking like in the other groups

Video https://github.com/oUF-wow/oUF/assets/23194902/7d64bce3-95f3-4e68-87fe-719dd6c88229

Nils89 commented 8 months ago

This is how I create the Name Text Font String:

 local function CreateRaisedText(raised)
    local text = raised:CreateFontString(nil, "OVERLAY")
    text:SetFont(UNIT_NAME_FONT, 11)
    text:SetShadowOffset(-1, -1)
    text:SetShadowColor(0, 0, 0, 1)

    return text
 end
   local name = GW.CreateRaisedText(frame.RaisedElementParent)

    name:SetShadowOffset(-1, -1)
    name:SetShadowColor(0, 0, 0, 1)
    name:SetJustifyH("LEFT")
    name:SetFont(UNIT_NAME_FONT, 12)

    frame.Name = name
local name = frame.Name

name:ClearAllPoints()
name:SetPoint("TOPLEFT", frame.Health, "TOPLEFT", 2, -2)

frame:Tag(name, "[GW2_Grid:name]")

GW2_Grid:name is just "return UnitName(r or u)

p3lim commented 8 months ago

You seem to have a sword icon to the left, I'm going to assume that's a tag as well, as you anchor your name object to the Health element. Please show the full code for this, as well as show how self.RaisedElementParent is created.

Nils89 commented 8 months ago

Have tested it also without the sword icon and only the name with the GW2_Grid:name tag. I tought also that the sword can cause this but it has the same behavior without it.

Here is the code from the RaisedElementParent and the Tag:

local function CreateRaisedElement(frame)
    local raised = CreateFrame("Frame", nil, frame)
    local level = frame:GetFrameLevel() + 100
    raised:SetFrameLevel(level)
    raised.__owner = frame
    raised.TextureParent = CreateFrame("Frame", nil, raised)

    return raised
end
AddTag("GW2_Grid:name", "UNIT_NAME_UPDATE", function(unit, realunit)
        return UnitName(realunit or unit)
    end)

local function AddTag(tagName, events, func)
    GW.oUF.Tags.Events[tagName] = events
    GW.oUF.Tags.Methods[tagName] = func
end
Nils89 commented 8 months ago

I will try to anchor the name to the frame itself and see if this is fixing this. :)

Nils89 commented 8 months ago

Ok, happens also if the name string is attached to the frame itself

Nils89 commented 8 months ago

The jiggle only happens with a frame size of 120x60 and only in group 5. with 121x60 is shifts to group 3

p3lim commented 5 months ago

This is not really a bug with oUF, just quirks with the UI rendering engine in WoW, closing it as such. You'll just have to play around with your anchors and offsets :shrug:.