Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68bebd3

Browse files
committed
Small fix to Gouraud triangles in pdf
svn path=/trunk/matplotlib/; revision=7622
1 parent f96e11d commit 68bebd3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def pdfRepr(obj):
141141
r = "%.10f" % obj
142142
return r.rstrip('0').rstrip('.')
143143

144+
# Booleans. Needs to be tested before integers since
145+
# isinstance(True, int) is true.
146+
elif isinstance(obj, bool):
147+
return ['false', 'true'][obj]
148+
144149
# Integers are written as such.
145150
elif isinstance(obj, (int, long)):
146151
return "%d" % obj
@@ -170,10 +175,6 @@ def pdfRepr(obj):
170175
r.append("]")
171176
return fill(r)
172177

173-
# Booleans.
174-
elif isinstance(obj, bool):
175-
return ['false', 'true'][obj]
176-
177178
# The null keyword.
178179
elif obj is None:
179180
return 'null'
@@ -1080,7 +1081,7 @@ def writeGouraudTriangles(self):
10801081
'BitsPerComponent': 8,
10811082
'BitsPerFlag': 8,
10821083
'ColorSpace': Name('DeviceRGB'),
1083-
'AntiAlias': 1,
1084+
'AntiAlias': True,
10841085
'Decode': [points_min[0], points_max[0],
10851086
points_min[1], points_max[1],
10861087
0, 1, 0, 1, 0, 1]

0 commit comments

Comments
 (0)