Errors when setting a backdrop without all properties #2


  • New
  • Defect
Open
Assigned to moonfann
  • Phanx created this issue Jan 14, 2014

    The default SetBackdrop API accepts a backdrop without every possible property. For example:

    frame:SetBackdrop({
        bgFile = "Interface\\FrameGeneral\\UI-Background-Rock",
        tile = true, tileSize = 256,
    })
    

    The default UI will apply this backdrop without complaint, treating it as the equivalent of:

    frame:SetBackdrop({
        bgFile = "Interface\\FrameGeneral\\UI-Background-Rock",
        tile = true, tileSize = 256,
        edgeFile = nil, edgeSize = 0,
        insets = { left = 0, right = 0, top = 0, bottom = 0 },
    })
    

    However, when I pass the same backdrop table (from the first example) to the replacement SetBackdrop method provided by LibBackdrop-1.0 I get errors about attempting to index nil values (specifically, insets and edgeSize). It does handle a nil edgeFile but even in that case requires that edgeSize and insets be set.

    The lib should probably fall back on nil/0 like the default API, both for maximal compatibility, and to avoid the need for redundant code in addons.

    Additionally, when edgeFile is not specified, the lib forcibly sets all the insets to 0, which does not mirror the behavior of the default API -- you can have insets without a border, if you don't want the backdrop extending all the way to the edges of the frame.

    Edit:
    If you're short on time, I can make these changes (default to nil textures, 0 sizes/insets, allow insets without edgeFile) for you, just let me know.

  • Phanx added the tags New Defect Jan 14, 2014
  • Phanx edited description Jan 14, 2014
  • moonfann posted a comment Jan 20, 2014

    Go ahead and make the changes ill tag it when complete. this weeks work fun is replacing ssd array in my db servers.

  • Phanx posted a comment Jan 30, 2014

    Committed.


To post a comment, please login or register a new account.