anchor.diff:      canvas.renderOnAddRemove = true;
       canvas.renderAll();
       <% end %>
  -  });
  +
  +  });
  +  <% else %>
  +    var line = makeLine([ <%= element.top %>, <%= element.width %>, <%= element.left %>, <%= element.height %>]);
  +
  +  console.log(<%= element.top %>, <%= element.left %> ,<%= element.width %>, <%= element.height %>);
  +
  +    line.toObject = (function (toObject) {
  +      return function () {
  +        var opts = {
  +          id: this.id,
  +          floor: this.floor,
  +          element_type_id: this.element_type_id,
  +          modified: this.modified,
  +          top: this.x1,
  +          left: this.x2,
  +          width: this.y1,
  +          height: this.y2
  +        }
  +
  +        return fabric.util.object.extend(toObject.call(this), opts);
  +      }
  +    })(fabric.Object.prototype.toObject);
  +
  +    line.set({
  +          floor: <%= element.floor %>,
  +          element_type_id: <%= element.element_type_id %>,
  +          modified: true,
  +          id: <%= element.id %>
  +        })
  +        .setCoords();
  +
  +  canvas.add(line);
  +
  +  circle1 = makeCircle(line.get('x1'), line.get('y1'), null, line);
  +  circle2 = makeCircle(line.get('x2'), line.get('y2'), line);
  +
  +  wallCircles.push(circle1,circle2);
  +
  +  canvas.add(circle1, circle2);
  +
  +  <% end %>
  +
  +  <% if index == elements.size - 1 %>
  +  canvas.renderAll();
  +  <% end %>
  +
     <% end %>
   
     function saveCanvas(){
       canvas.deactivateAll();
  -    var obj = canvas.getObjects().filter(function(o) {return o.modified == true} );
  -
  -    console.log(JSON.stringify(obj));
  +    removeWallCircles();
  +
  +    var obj = canvas.getObjects().filter(function(o) {
  +      return o.modified == true
  +    } );
  +
  +//    console.log(JSON.stringify(obj));
   
       $.ajax({
         url : "/admin/"+<%= @floor %>,
         type : "post",
         data : { elements: JSON.stringify(obj) }
       });
  +
  +    restoreWallCircles();
     }
   
     $( "#commands" )
  
positive.code:       data : { svg_data: data }
      });
  
      canvas.width = w;
      canvas.height = h;
      canvas.add(grid);
  
negative.code:     opacity: 0.3
    });
  
    wallCircles = [];
  
  
    var minZoom = canvas.width / boundingBox.width
    canvas.viewport.zoom = minZoom;
    $("#zoomSlider").attr("min", minZoom);
  