commit a823f6e017cbf6bd58c6371b28c43521bb5629e8
parent 648e166e66d56b95ed049ae51bd3facae40b39d1
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Tue, 28 Mar 2017 11:40:43 +0300
[print] added assertion on canvas sizes in blendMultiplyCanvas
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/lib/leaflet.control.printPages/map-render.js b/src/lib/leaflet.control.printPages/map-render.js
@@ -59,6 +59,9 @@ function getLayersForPrint(map, xhrQueue) {
}
function blendMultiplyCanvas(src, dest) {
+ if (src.width !== dest.width || src.height !== dest.height) {
+ throw new Error('Canvas size mismatch');
+ }
var s_data = src.getContext('2d').getImageData(0, 0, src.width, src.height).data;
var d_image_data = dest.getContext('2d').getImageData(0, 0, src.width, src.height);
var d_data = d_image_data.data;