|
@@ -29,7 +29,7 @@ const tools = {
|
|
|
},
|
|
|
|
|
|
mouseup(e){
|
|
|
- currentArray.push(current)
|
|
|
+
|
|
|
current = null
|
|
|
}
|
|
|
},
|
|
@@ -231,7 +231,7 @@ color.onchange = () => {
|
|
|
}
|
|
|
|
|
|
document.getElementById('delete').onclick = () =>{
|
|
|
- Drawable.instances = Drawable.instances.filter(item => !selection.includes(item))
|
|
|
+ Drawable.instances = [];
|
|
|
selection = []
|
|
|
Drawable.drawAll()
|
|
|
}
|
|
@@ -308,11 +308,11 @@ class Ellipse extends Drawable {
|
|
|
|
|
|
let undo = document.getElementById("undo");
|
|
|
undo.onclick = () => {
|
|
|
-
|
|
|
- currentArray.pop()
|
|
|
+ debugger
|
|
|
+ Drawable.instances.pop()
|
|
|
ctx.clearRect(0, 0, 400, 400);
|
|
|
|
|
|
- for(let key of currentArray) {
|
|
|
+ for(let key of Drawable.instances) {
|
|
|
if (key != 0) {
|
|
|
key.draw()
|
|
|
}
|