Fixing untitled saving

This commit is contained in:
Matt Bierner
2020-07-28 15:49:07 -07:00
parent 5d95c0fa44
commit 0b0df69b9b
2 changed files with 6 additions and 6 deletions

View File

@ -182,9 +182,9 @@
*/
async resetUntitled(strokes = []) {
const size = 100;
this.initialCanvas.width = size;
this.initialCanvas.height = size;
this.initialCanvas.width = this.drawingCanvas.width = size;
this.initialCanvas.height = this.drawingCanvas.height = size;
this.initialCtx.save();
{
this.initialCtx.fillStyle = 'white';
@ -245,7 +245,7 @@
{
// Get the image data for the canvas and post it back to the extension.
editor.getImageData().then(data => {
vscode.postMessage({ type: 'response', requestId, body: data });
vscode.postMessage({ type: 'response', requestId, body: Array.from(data) });
});
return;
}

View File

@ -248,8 +248,8 @@ export class PawDrawEditorProvider implements vscode.CustomEditorProvider<PawDra
throw new Error('Could not find webview to save for');
}
const panel = webviewsForDocument[0];
const response = await this.postMessageWithResponse<{ data: number[] }>(panel, 'getFileData', {});
return new Uint8Array(response.data);
const response = await this.postMessageWithResponse<number[]>(panel, 'getFileData', {});
return new Uint8Array(response);
}
});