mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-10 14:42:13 -05:00
Update update-image-hoc.jsx
This commit is contained in:
parent
9491b7eb09
commit
7351468041
1 changed files with 2 additions and 2 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue