mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Don't allow empty strokes
This commit is contained in:
@ -128,13 +128,15 @@
|
||||
document.body.classList.remove('isDrawing');
|
||||
this.drawingCtx.closePath();
|
||||
|
||||
const stroke = this.endStroke();
|
||||
const edit = this.endStroke();
|
||||
|
||||
vscode.postMessage({
|
||||
type: 'stroke',
|
||||
color: this.drawingColor,
|
||||
stroke: stroke.stroke,
|
||||
});
|
||||
if (edit.stroke.length) {
|
||||
vscode.postMessage({
|
||||
type: 'stroke',
|
||||
color: edit.color,
|
||||
stroke: edit.stroke,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
parent.addEventListener('mousemove', e => {
|
||||
|
||||
Reference in New Issue
Block a user