8000 Merge pull request #19820 from meeseeksmachine/auto-backport-of-pr-19… · matplotlib/matplotlib@cc25819 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc25819

Browse files
authored
Merge pull request #19820 from meeseeksmachine/auto-backport-of-pr-19817-on-v3.4.x
Backport PR #19817 on branch v3.4.x (Fix antialiasing with old pycairo/cairocffi.)
2 parents 315ff06 + d1c4004 commit cc25819

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
249249
ctx.set_font_size(prop.get_size_in_points() * self.dpi / 72)
250250
opts = cairo.FontOptions()
251251
opts.set_antialias(
252-
cairo.Antialias.DEFAULT if mpl.rcParams["text.antialiased"]
253-
else cairo.Antialias.NONE)
252+
cairo.ANTIALIAS_DEFAULT if mpl.rcParams["text.antialiased"]
253+
else cairo.ANTIALIAS_NONE)
254254
ctx.set_font_options(opts)
255255
if angle:
256256
ctx.rotate(np.deg2rad(-angle))
@@ -356,7 +356,7 @@ def set_alpha(self, alpha):
356356

357357
def set_antialiased(self, b):
358358
self.ctx.set_antialias(
359-
cairo.Antialias.DEFAULT if b else cairo.Antialias.NONE)
359+
cairo.ANTIALIAS_DEFAULT if b else cairo.ANTIALIAS_NONE)
360360

361361
def set_capstyle(self, cs):
362362
self.ctx.set_line_cap(_api.check_getitem(self._capd, capstyle=cs))

0 commit comments

Comments
 (0)
0