[Plib-users] Fwd: Bug in fntTexFont::getBBox?
Brought to you by:
sjbaker
From: Mark H. S. <sh...@pt...> - 2002-11-09 20:50:40
|
I forgot to mention that is in plib-1.6.0. - Mark >X-Sender: sh...@ga... >X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 >Date: Sat, 09 Nov 2002 12:44:58 -0800 >To: pli...@li... >From: "Mark H. Shirley" <sh...@pt...> >Subject: Bug in fntTexFont::getBBox? >Cc: msh...@ar... > >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 |