mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Fixing untitled saving
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user