projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #477 from danvk/461-retina
[dygraphs.git]
/
dygraph-utils.js
diff --git
a/dygraph-utils.js
b/dygraph-utils.js
index
f4bb2ff
..
4f90c65
100644
(file)
--- a/
dygraph-utils.js
+++ b/
dygraph-utils.js
@@
-735,13
+735,13
@@
Dygraph.getContextPixelRatio = function(context) {
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
- context.backingStorePixelRatio;
- if (devicePixelRatio !== undefined &&
- backingStorePixelRatio !== undefined) {
+ context.backingStorePixelRatio || 1;
+ if (devicePixelRatio !== undefined) {
return devicePixelRatio / backingStoreRatio;
} else {
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) {
return 1;
}
} catch (e) {