Fix problem with zero size canvas drawing
This commit is contained in:
+9
-6
@@ -135,12 +135,15 @@ export function render(width, height, pixelRatio,
|
|||||||
const srcWidth = getWidth(src.extent);
|
const srcWidth = getWidth(src.extent);
|
||||||
const srcHeight = getHeight(src.extent);
|
const srcHeight = getHeight(src.extent);
|
||||||
|
|
||||||
stitchContext.drawImage(
|
// This test should never fail -- but it does. Need to find a fix the upstream condition
|
||||||
src.image,
|
if (src.image.width > 0 && src.image.height > 0) {
|
||||||
gutter, gutter,
|
stitchContext.drawImage(
|
||||||
src.image.width - 2 * gutter, src.image.height - 2 * gutter,
|
src.image,
|
||||||
xPos * stitchScale, yPos * stitchScale,
|
gutter, gutter,
|
||||||
srcWidth * stitchScale, srcHeight * stitchScale);
|
src.image.width - 2 * gutter, src.image.height - 2 * gutter,
|
||||||
|
xPos * stitchScale, yPos * stitchScale,
|
||||||
|
srcWidth * stitchScale, srcHeight * stitchScale);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const targetTopLeft = getTopLeft(targetExtent);
|
const targetTopLeft = getTopLeft(targetExtent);
|
||||||
|
|||||||
Reference in New Issue
Block a user