Revision: 7839
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7839&view=rev
Author:   mdboom
Date:     2009-10-01 14:07:59 +0000 (Thu, 01 Oct 2009)

Log Message:
-----------
Fix bug in last commit that caused unit test to fail.

Modified Paths:
--------------
    trunk/matplotlib/src/ft2font.cpp

Modified: trunk/matplotlib/src/ft2font.cpp
===================================================================
--- trunk/matplotlib/src/ft2font.cpp    2009-10-01 12:57:39 UTC (rev 7838)
+++ trunk/matplotlib/src/ft2font.cpp    2009-10-01 14:07:59 UTC (rev 7839)
@@ -898,12 +898,15 @@
   for ( size_t n = 0; n < glyphs.size(); n++ ) {
     FT_BBox glyph_bbox;
     FT_Glyph_Get_CBox( glyphs[n], ft_glyph_bbox_subpixels, &glyph_bbox );
-    if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin;
-    if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin;
-    if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax;
-    if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax;
-    right_side += glyphs[n]->advance.x >> 10;
-    if ( right_side > bbox.xMax ) bbox.xMax = right_side;
+    if (glyph_bbox.xMin == glyph_bbox.xMax) {
+      right_side += glyphs[n]->advance.x >> 10;
+      if ( right_side > bbox.xMax ) bbox.xMax = right_side;
+    } else {
+      if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin;
+      if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin;
+      if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax;
+      if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax;
+    }
   }
   /* check that we really grew the string bbox */
   if ( bbox.xMin > bbox.xMax ) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to