Update update-image-hoc.jsx

This commit is contained in:
Paul Kaplan 2019-12-09 16:18:21 -05:00 committed by GitHub
parent 9491b7eb09
commit 7351468041
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,13 +90,13 @@ const UpdateImageHOC = function (WrappedComponent) {
}
const rect = getHitBounds(plasteredRaster);
// Use 1x1 instead of 0x0 for getting imageData since paper.js automagically
// Use 1x1 instead of 0x0 for getting imageData since paper.js automagically
// returns the full artboard in the case of getImageData(0x0).
// Bitmaps need a non-zero width/height in order to be saved as PNG.
if (rect.width === 0 || rect.height === 0) {
rect.width = rect.height = 1;
}
const imageData = plasteredRaster.getImageData(rect);
this.props.onUpdateImage(