I am using Kineticjs. I am trying to have bound (dragBoundFunc) on the drag like the one below (http://jsfiddle.net/m1erickson/n5xMs):
dragBoundFunc: function (pos) {
var X = pos.x;
var Y = pos.y;
if (X < minX) {
X = minX;
}
if (X > maxX) {
X = maxX;
}
if (Y < minY) {
Y = minY;
}
if (Y > maxY) {
Y = maxY;
}
return ({
x: X,
y: Y
});
}
});
and I am trying use this approach for a group which is drag-able and re-sizable like this http://jsbin.com/iyimuy/125/edit but I am not able to make it work.I would love to hear some comments.