Revision: 8564
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8564&view=rev
Author:   leejjoon
Date:     2010-07-17 07:06:06 +0000 (Sat, 17 Jul 2010)

Log Message:
-----------
fix wrong baseline for multiple line legend

Modified Paths:
--------------
    branches/v1_0_maint/lib/matplotlib/offsetbox.py

Modified: branches/v1_0_maint/lib/matplotlib/offsetbox.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/offsetbox.py     2010-07-16 20:55:35 UTC 
(rev 8563)
+++ branches/v1_0_maint/lib/matplotlib/offsetbox.py     2010-07-17 07:06:06 UTC 
(rev 8564)
@@ -641,14 +641,14 @@
         bbox, info = self._text._get_layout(renderer)
         w, h = bbox.width, bbox.height
 
-        line = info[0][0] # first line
-
+        line = info[-1][0] # last line
         _, hh, dd = renderer.get_text_width_height_descent(
             line, self._text._fontproperties, ismath=ismath)
+        d = dd  # the baseline of the last line
 
+        self._baseline_transform.clear()
 
-        self._baseline_transform.clear()
-        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)


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 Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to