[Plib-users] Bug in fntTexFont::getBBox?
Brought to you by:
sjbaker
From: Mark H. S. <sh...@pt...> - 2002-11-09 20:45:06
|
I'm trying to use the code that computes bounding boxes for strings in the fnt library. The documentation page says it works for strings with embedded newlines, and the code that computes the bounding box does appear to handle that. At least, it does so correctly in the Y direction. In the X direction, it computes the width of the longest line but doesn't return that. It returns the width of the last line. (I'm referring to fntTexFont::getBBox in fnt.cxx.) I believe this is a bug, but I don't know what code elsewhere in the plib libraries might depend upon it. Correcting the assignments at the end of fntTexFont::getBBox like this: if ( left != NULL ) *left = l * pointsize ; if ( right != NULL ) *right = max_r * pointsize ; /* return max_r */ if ( top != NULL ) *top = t * pointsize ; if ( bot != NULL ) *bot = max_b * pointsize ; /* return max_b */ ... fixes things in my application. - Mark Shirley |