Calculating FontString height
I've got an addon that my guild uses, but some people are having trouble when they use UI Scaling, and I can't quite get it fixed. We've got a FontString inside a Frame, and the Frame is resized as the FontString grows/shrinks. The width of the frame isn't a problem, but the height doesn't work right - some people are getting text cut off at the bottom. I'm calculating the height of the frame with the following formula:
number of lines of text * height of one line + 14
The "+ 14" is because the FontString is anchored 7 pixels from each edge of the Frame, so the Frame should always be 14 pixels (or units, or whatever you want to call it when scaling happens) taller and wider.
I'm getting the height of one line of text from the GetFont() method, but perhaps that isn't right? I'm not accounting for any scaling in my stuff because it seems like the engine should handle that. Any idea about what I'm doing wrong here?
|