From: <lee...@us...> - 2009-04-17 02:31:20
|
Revision: 7046 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7046&view=rev Author: leejjoon Date: 2009-04-17 02:31:16 +0000 (Fri, 17 Apr 2009) Log Message: ----------- Fixed a offsetbox bug that multiline texts are not correctly aligned. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/offsetbox.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2009-04-16 17:30:29 UTC (rev 7045) +++ trunk/matplotlib/CHANGELOG 2009-04-17 02:31:16 UTC (rev 7046) @@ -1,5 +1,8 @@ ====================================================================== +2009-04-16 Fixed a offsetbox bug that multiline texts are not + correctly aligned. - JJL + 2009-04-16 Fixed a bug in mixed mode renderer that images produced by an rasterizing backend are placed with incorrect size. - JJL @@ -17,7 +20,7 @@ create an output file. Thanks to Joao Luis Silva for reporting this. - JKS -2009-04-05 _png.read_png() reads 12 bit PNGs (patch from +2009-04-05 _png.read_png() reads 12 bit PNGs (patch from Tobias Wood) - ADS 2009-04-04 Allow log axis scale to clip non-positive values to Modified: trunk/matplotlib/lib/matplotlib/offsetbox.py =================================================================== --- trunk/matplotlib/lib/matplotlib/offsetbox.py 2009-04-16 17:30:29 UTC (rev 7045) +++ trunk/matplotlib/lib/matplotlib/offsetbox.py 2009-04-17 02:31:16 UTC (rev 7046) @@ -620,27 +620,26 @@ line = info[0][0] # first line _, hh, dd = renderer.get_text_width_height_descent( - clean_line, self._text._fontproperties, ismath=ismath) + line, self._text._fontproperties, ismath=ismath) self._baseline_transform.clear() - if len(info) > 1 and self._multilinebaseline: # multi line - d = h-(hh-dd) # the baseline of the first line + d = h-(hh-dd) # the baseline of the first line + if len(info) > 1 and self._multilinebaseline: d_new = 0.5 * h - 0.5 * (h_ - d_) - self._baseline_transform.translate(0, d - d_new) d = d_new else: # single line - h_d = max(h_ - d_, h-dd) + h_d = max(h_ - d_, h-d) if self.get_minimumdescent(): ## to have a minimum descent, #i.e., "l" and "p" have same ## descents. - d = max(dd, d_) - else: - d = dd + d = max(d, d_) + #else: + # d = d h = h_d + d This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |