Skip to content

Commit

Permalink
add backing store ratio computation, fix imsky#31
Browse files Browse the repository at this point in the history
  • Loading branch information
imsky committed Jan 27, 2013
1 parent 341be06 commit 54fcb72
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions holder.js
Expand Up @@ -79,17 +79,19 @@ function render(mode, el, holder, src) {
theme = holder.theme,
text = holder.text ? decodeURIComponent(holder.text) : holder.text;
var dimensions_caption = dimensions.width + "x" + dimensions.height;

theme = (text ? extend(theme, {
text: text
}) : theme);
theme = (holder.font ? extend(theme, {
font: holder.font
}) : theme);

var dpr = window.devicePixelRatio || 1,
bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;

var ratio = dpr / bsr;

var ratio = 1;
if (window.devicePixelRatio && window.devicePixelRatio > 1) {
ratio = window.devicePixelRatio;
}

if (mode == "image") {
el.setAttribute("data-src", src);
Expand Down

0 comments on commit 54fcb72

Please sign in to comment.