Alexander Deplov

Right way to move objects

Right way to move objects

Code

var path = new Path.Circle({
    radius: 30,
    fillColor: 'blue',
    position: view.center
})

path.onMouseDrag = function(event){
    this.position += event.delta
    this.fillColor.hue += event.delta.x + event.delta.y
}

//Wrong way. Since it's centering object on move:

//path.onMouseDrag = function(event){
//    this.position = event.point
//}