Revision: 3667 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3667&view=rev Author: mdboom Date: 2007-08-02 12:07:02 -0700 (Thu, 02 Aug 2007)
Log Message: ----------- Small bugfix with auto-sized delimiters Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-02 18:59:29 UTC (rev 3666) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-02 19:07:02 UTC (rev 3667) @@ -1412,20 +1412,15 @@ state = state.copy() target_total = height + depth - big_enough = False for fontname, sym in alternatives: state.font = fontname char = Char(sym, state) - if char.height + char.depth > target_total: - big_enough = True + if char.height + char.depth >= target_total: break - # If the largest option is still not big enough, just do - # simple scale on it. - if not big_enough: - factor = target_total / (char.height + char.depth) - state.fontsize *= factor - char = Char(sym, state) + factor = target_total / (char.height + char.depth) + state.fontsize *= factor + char = Char(sym, state) shift = (depth - char.depth) Hlist.__init__(self, [char]) @@ -1442,20 +1437,15 @@ state.font, c) state = state.copy() - big_enough = False for fontname, sym in alternatives: state.font = fontname char = char_class(sym, state) - if char.width > width: - big_enough = True + if char.width >= width: break - # If the largest option is still not big enough, just do - # simple scale on it. - if not big_enough: - factor = width / char.width - state.fontsize *= factor - char = char_class(sym, state) + factor = width / char.width + state.fontsize *= factor + char = char_class(sym, state) Hlist.__init__(self, [char]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins