Why doesn"t re-setting the points
property and then calling the draw
method not empty the previous painting?
when clicked, it becomes two lines
$(function() {
const stage = new Konva.Stage({
container: "-sharpcontainer",
width: window.innerWidth,
height: window.innerHeight,
});
const layer = new Konva.Layer();
const line = new Konva.Line({
points: [10, 10, 100, 100],
stroke: "black",
strokeWidth: 3,
});
line.on("click", event => {
line.points([10, 10, 100, 10]);
line.draw();
});
layer.add(line);
stage.add(layer);
});
</script>