There is some sort of issue going on in UpdateImageAnchor within the "Label" widget where occasionally execution of code halts when image:GetHeight() is called. Preventing the rest of the positioning and code to execute properly. I used print() and debug() lines and you can clearly see when the code just randomly halts on a few occasions.
To reproduce this issue, you will need BagSync installed.
Create a gnome character then kill a wolf. Get a ruined pelt.
Open BagSync search and do a search for "ruin" you should get one result.
Now type in "test" and search for that to clear it.
Search for "ruin" once again and you will notice the bar is returned but the labeling is not position correctly.
If you analyze the executions during this process. UpdateImageAnchor stops execution around the time it hits image:GetHeight(). To further test this. I replaced all instances of image:GetHeight() the number 18 in the function. (basically I hardcoded a size). I repeated the steps above and it worked perfectly. Which is telling me that somehow in some way the code execution of this particular function just randomly stops execution when image:GetHeight() is called. It took me quite a awhile to figure this out as I had to use several debug lines in several locations numbered to see what was going on. At first I thought it was
["SetImageSize"] = function(self, width, height)
self.image.width = width
self.image.height = height
and an updated
if self.imageshown then
local imageHeight = image.height or 16
local imageWidth = image.width or 16
if (width - imageWidth) < 200 or (label:GetText() or "") == "" then
-- image goes on top centered when less than 200 width for the text, or if there is no text
label:SetPoint("TOP", image, "BOTTOM")
height = imageHeight + label:GetStringHeight()
-- image on the left
if imageHeight > label:GetStringHeight() then
label:SetPoint("LEFT", image, "RIGHT", 4, 0)
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0)
label:SetWidth(width - imageWidth - 4)
height = max(imageHeight, label:GetStringHeight())
-- no image shown
height = label:GetStringHeight()
Seem to fix the issue. Again, I cannot pinpoint why that method is preventing the rest of the code to execute.
To post a comment, please
or register a new account.