Skip to content

Commit

Permalink
🐞 Fix resize bug for high pixel ratio. metafizzy#41
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Jun 4, 2019
1 parent 8079190 commit 9e560a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/illustration.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ Illustration.prototype.setSizeCanvas = function( width, height ) {
var pixelRatio = this.pixelRatio = window.devicePixelRatio || 1;
this.element.width = this.canvasWidth = width * pixelRatio;
this.element.height = this.canvasHeight = height * pixelRatio;
if ( pixelRatio > 1 ) {
var needsHighPixelRatioSizing = pixelRatio > 1 && !this.resize;
if ( needsHighPixelRatioSizing ) {
this.element.style.width = width + 'px';
this.element.style.height = height + 'px';
}
Expand Down

0 comments on commit 9e560a1

Please sign in to comment.