This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
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:SetWidth(width) self.image:SetHeight(height) self.image.width = width self.image.height = height self.image:SetHeight(height) UpdateImageAnchor(self) end,
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 image:SetPoint("TOP") label:SetPoint("TOP", image, "BOTTOM") label:SetPoint("LEFT") label:SetWidth(width) height = imageHeight + label:GetStringHeight() else -- image on the left image:SetPoint("TOPLEFT") if imageHeight > label:GetStringHeight() then label:SetPoint("LEFT", image, "RIGHT", 4, 0) else label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) end label:SetWidth(width - imageWidth - 4) height = max(imageHeight, label:GetStringHeight()) end else -- no image shown label:SetPoint("TOPLEFT") label:SetWidth(width) height = label:GetStringHeight() end
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 login or register a new account.