kimoa / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
3 stars 0 forks source link

control the way an object behave like movable, editable, and delete-able #890

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i auto load a template on pageload, and i want lock certain thing like logo.

here what i got so far
modify the svgcanvas.js

add code in [mouseDown, mouseMove,and mouseUp]

if(selectedElements[0] != null){
  var cm = selectedElements[0].getAttribute('custommove');
  if(cm != null){
    clearSelection();
    return;
  }
}

then add the attribute "custommove" to the object in the svg

This will prevent item from move or edit. 
item can still be delete and move by arrow key (if try really hard) which is my 
next step

Note: if i add attribute "custommove" in the svg before load. the attribute is 
discarded. i'm assume load does not know attribute "custommove" therefore it 
get discarded.

i want to code in an extension, since i do not want to modify the core; is it 
possible? could someone please advice?

Original issue reported on code.google.com by PaulS...@gmail.com on 15 Dec 2011 at 10:29