From: <md...@us...> - 2008-03-26 14:43:33
|
Revision: 5024 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5024&view=rev Author: mdboom Date: 2008-03-26 07:43:20 -0700 (Wed, 26 Mar 2008) Log Message: ----------- Merged revisions 5012-5017,5019-5023 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5013 | mmetz_bn | 2008-03-21 13:19:37 -0400 (Fri, 21 Mar 2008) | 1 line Bugfix in ContourSet._process_linestyles ........ r5021 | mdboom | 2008-03-26 10:30:18 -0400 (Wed, 26 Mar 2008) | 3 lines Change character ids so they are a hash on the path data itself. (To fix Kaushik Ghose's copy-and-paste in Inkscape bug). ........ r5022 | mdboom | 2008-03-26 10:33:35 -0400 (Wed, 26 Mar 2008) | 3 lines Change character ids so they are a hash on the path data itself. (To fix Kaushik Ghose's copy-and-paste in Inkscape bug). ........ r5023 | mdboom | 2008-03-26 10:35:50 -0400 (Wed, 26 Mar 2008) | 2 lines Oops in last commit. ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/backend_svg.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5011,5018 + /branches/v0_91_maint:1-5023 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-03-26 14:35:50 UTC (rev 5023) +++ trunk/matplotlib/CHANGELOG 2008-03-26 14:43:20 UTC (rev 5024) @@ -1,3 +1,6 @@ +2008-03-26 Fix SVG backend bug that prevents copying and pasting in + Inkscape (thanks Kaushik Ghose) - MGD + 2008-03-24 Removed an unnecessary call to draw() in the backend_qt* mouseReleaseEvent. Thanks to Ted Drain - DSD Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-03-26 14:35:50 UTC (rev 5023) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-03-26 14:43:20 UTC (rev 5024) @@ -1,6 +1,6 @@ from __future__ import division -import os, codecs, base64, tempfile, urllib, gzip +import os, codecs, base64, tempfile, urllib, gzip, md5 from matplotlib import verbose, __version__, rcParams from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ @@ -125,7 +125,7 @@ id = self._clipd.get(path) if id is None: - id = 'p%x' % len(self._clipd) + id = 'p%s' % md5.new(path).hexdigest() self._svgwriter.write('<defs>\n <clipPath id="%s">\n' % id) self._svgwriter.write(path) self._svgwriter.write('\n </clipPath>\n</defs>') @@ -189,7 +189,7 @@ key = self._convert_path(marker_path, marker_trans + Affine2D().scale(1.0, -1.0)) name = self._markers.get(key) if name is None: - name = 'm%x' % len(self._markers) + name = 'm%s' % md5.new(key).hexdigest() write('<defs><path id="%s" d="%s"/></defs>\n' % (name, key)) self._markers[key] = name @@ -209,9 +209,10 @@ write('<defs>\n') for i, (path, transform) in enumerate(self._iter_collection_raw_paths( master_transform, paths, all_transforms)): - name = 'coll%x_%x' % (self._path_collection_id, i) transform = Affine2D(transform.get_matrix()).scale(1.0, -1.0) d = self._convert_path(path, transform) + name = 'coll%x_%x_%s' % (self._path_collection_id, i, + md5.new(d).hexdigest()) write('<path id="%s" d="%s"/>\n' % (name, d)) path_codes.append(name) write('</defs>\n') @@ -398,8 +399,9 @@ if step[0] != 4: currx, curry = step[-2], -step[-1] - char_num = 'c%x' % len(self._char_defs) - path_element = '<path id="%s" d="%s"/>\n' % (char_num, ''.join(path_data)) + path_data = ''.join(path_data) + char_num = 'c_%s' % md5.new(path_data).hexdigest() + path_element = '<symbol id="%s"><path d="%s"/></symbol>\n' % (char_num, ''.join(path_data)) self._char_defs[char_id] = char_num return path_element This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |