X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-utils.js;h=4f90c65e2480a9a992b823e6dab35fc680c4679b;hb=9f79cb9489fd18858e4f5b661cb4b03be988b3b3;hp=f4bb2ffccdabce5207cc62d63402e1fa39fbdcf0;hpb=8887663f6cb6a96cecc1c88d46720438cbab9db0;p=dygraphs.git diff --git a/dygraph-utils.js b/dygraph-utils.js index f4bb2ff..4f90c65 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -735,13 +735,13 @@ Dygraph.getContextPixelRatio = function(context) { context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || - context.backingStorePixelRatio; - if (devicePixelRatio !== undefined && - backingStorePixelRatio !== undefined) { + context.backingStorePixelRatio || 1; + if (devicePixelRatio !== undefined) { return devicePixelRatio / backingStoreRatio; } else { - // If either value is undefined, the ratio is meaningless so we want to - // return 1. + // At least devicePixelRatio must be defined for this ratio to make sense. + // We default backingStoreRatio to 1: this does not exist on some browsers + // (i.e. desktop Chrome). return 1; } } catch (e) {