Fix matplotlib wasm backend after undefined attribute behavior changed

This commit is contained in:
Michael Droettboom 2019-02-21 18:09:16 -05:00
parent 8da4b1f5f1
commit 68de9439cd
1 changed files with 7 additions and 7 deletions

View File

@ -90,15 +90,15 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
This is typically 2 on a HiDPI ("Retina") display, and 1 otherwise. This is typically 2 on a HiDPI ("Retina") display, and 1 otherwise.
""" """
backing_store = ( backing_store = (
context.backingStorePixelRatio or getattr(context, 'backingStorePixelRatio', 0) or
context.webkitBackingStorePixel or getattr(context, 'webkitBackingStorePixel', 0) or
context.mozBackingStorePixelRatio or getattr(context, 'mozBackingStorePixelRatio', 0) or
context.msBackingStorePixelRatio or getattr(context, 'msBackingStorePixelRatio', 0) or
context.oBackingStorePixelRatio or getattr(context, 'oBackingStorePixelRatio', 0) or
context.backendStorePixelRatio or getattr(context, 'backendStorePixelRatio', 0) or
1 1
) )
return (window.devicePixelRatio or 1) / backing_store return (getattr(window, 'devicePixelRatio', 0) or 1) / backing_store
def create_root_element(self): def create_root_element(self):
# Designed to be overridden by subclasses for use in contexts other # Designed to be overridden by subclasses for use in contexts other