Closed paynterf closed 3 years ago
Sorry, it has been awhile since I looked at any of this stuff. I am not sure if @mjs513 remembers any better than I do?
If I remember correctly the code probably uses the full text width and logical height of the text to where the start of the next character would draw and likewise where the start of the next row of text would be.
And especially with height this can be a relative large distance.
Unfortunately I don't remember any better than @KurtE - its been a long while since I looked at it as well.
OK, I'll poke around some more & see if I can figure out what is going on
Frank
You might try syncing my latest changes and see if that makes a difference.
I am using the 'getTextBounds' function to retrieve the bounds for text to be placed on top of a filled rectangle, so I can place the text in the middle of the rectangle
However, it seems both the width and height are much larger than the actual number of pixels occupied by the text. By changing the dimensions of the underlying rectangle, I could approximate the on-screen dimensions of a text string, and the approximate dimension were approximately 1/2 the reported values.
Here's a snippet to demo the problem
When this was run, I got the following
bounds are 160,180,120,40
but a filled rectangle with dimensions of
just encloses the text
This is Orientation 1 (0<=x<=320, 0<=y<=240) if it matters