Skip to content

Commit

Permalink
Merge pull request mozilla#5660 from timvandermeij/thumbnails-setimage
Browse files Browse the repository at this point in the history
Fill temporary canvases with a white background too
  • Loading branch information
Snuffleupagus authored and speedplane committed Feb 24, 2015
2 parents 65322af + 5ec2b35 commit b51167c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/thumbnail_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ var ThumbnailView = function thumbnailView(container, id, defaultViewport,
}
tempCanvas.width = width;
tempCanvas.height = height;

// Since this is a temporary canvas, we need to fill
// the canvas with a white background ourselves.
// |getPageDrawContext| uses CSS rules for this.
var ctx = tempCanvas.getContext('2d');
ctx.save();
ctx.fillStyle = 'rgb(255, 255, 255)';
ctx.fillRect(0, 0, width, height);
ctx.restore();
return tempCanvas;
}

Expand Down

0 comments on commit b51167c

Please sign in to comment.