X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-utils.js;h=5c55855213101a6df1c5ddac2574969c7a852e96;hb=3a0e53a45ffaf12515f99f905221ba59490961fa;hp=73777b91828d3574aa96d2139fd00d3f0d40968a;hpb=9ab1543103d04984e905a9de2f9368824413cd44;p=dygraphs.git diff --git a/dygraph-utils.js b/dygraph-utils.js index 73777b9..5c55855 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -734,13 +734,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) {