maryluis пре 4 година
родитељ
комит
d8514d6c23
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      homework19/script.js

+ 5 - 5
homework19/script.js

@@ -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()
         }