Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c22826

Browse files
committed
[3010045] leading whitespace removed from text
svn path=/trunk/matplotlib/; revision=8373
1 parent e8f143c commit 7c22826

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ft2font.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,15 +916,15 @@ FT2Font::compute_string_bbox( ) {
916916
for ( size_t n = 0; n < glyphs.size(); n++ ) {
917917
FT_BBox glyph_bbox;
918918
FT_Glyph_Get_CBox( glyphs[n], ft_glyph_bbox_subpixels, &glyph_bbox );
919+
if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin;
920+
if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin;
919921
if (glyph_bbox.xMin == glyph_bbox.xMax) {
920922
right_side += glyphs[n]->advance.x >> 10;
921923
if ( right_side > bbox.xMax ) bbox.xMax = right_side;
922924
} else {
923-
if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin;
924-
if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin;
925925
if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax;
926-
if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax;
927926
}
927+
if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax;
928928
}
929929
/* check that we really grew the string bbox */
930930
if ( bbox.xMin > bbox.xMax ) {

0 commit comments

Comments
 (0)