[Pkg-javascript-commits] [pdf.js] 54/116: Fill temporary canvases with a white background too

David Prévot taffit at moszumanska.debian.org
Fri Mar 6 16:20:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 879f3d2c5ac8c0183721d409ef99d020ed929bb7
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Mon Jan 19 22:01:55 2015 +0100

    Fill temporary canvases with a white background too
---
 web/thumbnail_view.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/web/thumbnail_view.js b/web/thumbnail_view.js
index 3b4120a..d01b42a 100644
--- a/web/thumbnail_view.js
+++ b/web/thumbnail_view.js
@@ -195,6 +195,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;
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list