test prevent defau

main
km0 1 year ago
parent 7f5f755113
commit 3743236f2c

@ -11,6 +11,7 @@ var strPath;
var buffer = []; // Contains the last positions of the mouse cursor var buffer = []; // Contains the last positions of the mouse cursor
const startDrawing = (e) => { const startDrawing = (e) => {
e.preventDefault();
bufferSize = 8; bufferSize = 8;
path = document.createElementNS("http://www.w3.org/2000/svg", "path"); path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttribute("fill", "none"); path.setAttribute("fill", "none");
@ -25,6 +26,7 @@ const startDrawing = (e) => {
}; };
const draw = (e) => { const draw = (e) => {
e.preventDefault();
if (path) { if (path) {
appendToBuffer(getMousePosition(e)); appendToBuffer(getMousePosition(e));
updateSvgPath(); updateSvgPath();

@ -1,3 +1,8 @@
html,
body {
background-color: dodgerblue;
}
#svgElement { #svgElement {
touch-action: none; background-color: white;
} }

Loading…
Cancel
Save