Skip to content

Instantly share code, notes, and snippets.

@afiedler
Created February 14, 2018 22:35
Show Gist options
  • Save afiedler/5013ea779bde7103ec70902a75cd471a to your computer and use it in GitHub Desktop.
Save afiedler/5013ea779bde7103ec70902a75cd471a to your computer and use it in GitHub Desktop.
(function() {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d")
var devicePixelRatio = window.devicePixelRatio || 1;
var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
ctx.backingStorePixelRatio || 1
console.log("devicePixelRatio: " + devicePixelRatio + "; backingStoreRatio: " + backingStoreRatio);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment