Revision: 6658
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6658&view=rev
Author: leejjoon
Date: 2008-12-18 08:55:50 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
fix dpi-dependent behavior of text bbox & annotate arrow
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/lib/matplotlib/text.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-17 23:37:18 UTC (rev 6657)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-18 08:55:50 UTC (rev 6658)
@@ -1,3 +1,6 @@
+2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
+ -JJL
+
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
======================================================================
Modified: branches/v0_98_5_maint/lib/matplotlib/text.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/text.py 2008-12-17 23:37:18 UTC
(rev 6657)
+++ branches/v0_98_5_maint/lib/matplotlib/text.py 2008-12-18 08:55:50 UTC
(rev 6658)
@@ -367,7 +367,8 @@
def update_bbox_position_size(self, renderer):
- """ Update the location and the size of the bbox. This method
+ """
+ Update the location and the size of the bbox. This method
should be used when the position and size of the bbox needs to
be updated before actually drawing the bbox.
"""
@@ -395,8 +396,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- fontsize = renderer.points_to_pixels(self.get_size())
- self._bbox_patch.set_mutation_scale(fontsize)
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
#self._bbox_patch.draw(renderer)
else:
@@ -434,7 +435,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- self._bbox_patch.set_mutation_scale(self.get_size())
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
self._bbox_patch.draw(renderer)
@@ -1557,6 +1559,7 @@
self.arrow_patch.set_positions((ox0, oy0), (ox1,oy1))
mutation_scale = d.pop("mutation_scale", self.get_size())
+ mutation_scale = renderer.points_to_pixels(mutation_scale)
self.arrow_patch.set_mutation_scale(mutation_scale)
if self._bbox_patch:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins