8000 added christophs dvipng_hack_alpha import fix · matplotlib/matplotlib@9b1249e · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b1249e

Browse files
committed
added christophs dvipng_hack_alpha import fix
svn path=/trunk/matplotlib/; revision=8482
1 parent 8999f6f commit 9b1249e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

CXX/WrapPython.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@
4444
#endif
4545

4646
// Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h
47-
#if defined(__sun) || defined(sun)
48-
#if defined(_XPG4)
4947
#undef _XPG4
50-
#endif
51-
#endif
5248

5349
// Python.h will redefine these and generate warning in the process
5450
#undef _XOPEN_SOURCE

lib/matplotlib/texmanager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class TexManager:
9191
if not os.path.exists(texcache):
9292
os.mkdir(texcache)
9393

94-
_dvipng_hack_alpha = dvipng_hack_alpha()
94+
_dvipng_hack_alpha = None
9595

9696
# mappable cache of
9797
rgba_arrayd = {}
@@ -516,8 +516,11 @@ def get_grey(self, tex, fontsize=None, dpi=None):
516516
if rcParams['text.dvipnghack'] is not None:
517517
hack = rcParams['text.dvipnghack']
518518
else:
519+
if self._dvipng_hack_alpha is None:
520+
self._dvipng_hack_alpha = dvipng_hack_alpha()
519521
hack = self._dvipng_hack_alpha
520522

523+
521524
if hack:
522525
# hack the alpha channel
523526
# dvipng assumed a constant background, whereas we want to

0 commit comments

Comments
 (0)
0