Revision: 6938
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6938&view=rev
Author: jouni
Date: 2009-02-26 19:54:48 +0000 (Thu, 26 Feb 2009)
Log Message:
-----------
Support image clipping in the pdf backend
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2009-02-26 19:44:30 UTC (rev 6937)
+++ branches/v0_98_5_maint/CHANGELOG 2009-02-26 19:54:48 UTC (rev 6938)
@@ -1,3 +1,5 @@
+2009-02-26 Support image clipping in pdf backend. - JKS
+
2009-02-16 Move plot_directive.py to the installed source tree. Add
support for inline code content - MGD
Modified: branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
2009-02-26 19:44:30 UTC (rev 6937)
+++ branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
2009-02-26 19:54:48 UTC (rev 6938)
@@ -39,7 +39,7 @@
from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, \
LOAD_NO_HINTING, KERNING_UNFITTED
from matplotlib.mathtext import MathTextParser
-from matplotlib.transforms import Affine2D, Bbox, BboxBase
+from matplotlib.transforms import Affine2D, Bbox, BboxBase, TransformedPath
from matplotlib.path import Path
from matplotlib import ttconv
@@ -1235,10 +1235,12 @@
return self.image_dpi/72.0
def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
- # MGDTODO: Support clippath here
gc = self.new_gc()
if bbox is not None:
gc.set_clip_rectangle(bbox)
+ if clippath is not None:
+ clippath = TransformedPath(clippath, clippath_trans)
+ gc.set_clip_path(clippath)
self.check_gc(gc)
h, w = im.get_size_out()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins