I know that I can obtain it with the width or size function, but I'm trying to do it in the moment of the creation of a draggable object.
I'm doing this because I need to give a grid effect to the element and also make it stay inside the drawable area.
Here is something similar to what I'm trying to do:
square = draw.rect(size, size).x(x).y(y).draggable(function(x, y){
var xend = x - x % size;
var yend = y - y % size;
if(xend < 0)
xend = 0;
if(yend < 0)
yend = 0;
if(xend > 1000)
xend = 1000 - width*;
return { x: xend, y: yend }
});
The var with an * is what I want to get.
Also would be great to know how to allow svg.js elements interact with jquery, but I guess that's for another question.
Edit: Well, now in fact I need to access to other properties of the element, if I can't do that from the draggable element I think I should look for another way to make it draggable? :( please help!