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

Skip to content

Commit 38d0b35

Browse files
committed
cairo backends do not support blitting; mark them as such.
Trying to run a blitting animation example on gtk3cairo currently fails with AttributeError: 'FigureCanvasGTK3Cairo' object has no attribute 'copy_from_bbox' While blitting can be made to work for e.g. qt5cairo, it cannot be for gtk3cairo which relies on gtk's windowing code to handle us a cairo context to directly draw on when a draw event occurs: the animation blitting code fundamentally assumes that it can modify the underlying buffer whenever it wants and that the windowing system simply displayes that buffer at each draw event.
1 parent 64874e5 commit 38d0b35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ def set_linewidth(self, w):
450450

451451

452452
class FigureCanvasCairo(FigureCanvasBase):
453+
supports_blit = False
454+
453455
def print_png(self, fobj, *args, **kwargs):
454456
width, height = self.get_width_height()
455457

0 commit comments

Comments
 (0)