Skip to content

Commit

Permalink
rendering improved on high resolution devices like iPhone 4
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkrause committed May 23, 2011
1 parent 735b29d commit 9a0000e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/cufon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,12 @@ Cufon.registerEngine('canvas', (function() {
}

var g = canvas.getContext('2d'), scale = height / viewBox.height;
var pixelRatio = window.devicePixelRatio || 1;
if (pixelRatio != 1) {
canvas.width = canvasWidth * pixelRatio;
canvas.height = canvasHeight * pixelRatio;
g.scale(pixelRatio, pixelRatio);
}

// proper horizontal scaling is performed later
g.scale(scale, scale * roundingFactor);
Expand Down

0 comments on commit 9a0000e

Please sign in to comment.