code: function(evt, x, y) {
  
          var paper = this.paper;
          var grid = paper.options.gridSize;
          var element = this.model;
          var position = element.position();
          var data = this.eventData(evt);
  
          // Make sure the new element's position always snaps to the current grid after
          // translate as the previous one could be calculated with a different grid size.
          var tx = g.snapToGrid(position.x, grid) - position.x + g.snapToGrid(x - data.x, grid);
          var ty = g.snapToGrid(position.y, grid) - position.y + g.snapToGrid(y - data.y, grid);
  
          element.translate(tx, ty, { restrictedArea: data.restrictedArea, ui: true });
  
          var embedding = !!data.embedding;
          if (paper.options.embeddingMode) {
              if (!embedding) {
                  // Prepare the element for embedding only if the pointer moves.
                  // We don't want to do unnecessary action with the element
                  // if an user only clicks/dblclicks on it.
                  this.prepareEmbedding(data);
                  embedding = true;
              }
              this.processEmbedding(data);
          }
  
          this.eventData(evt, {
              x: g.snapToGrid(x, grid),
              y: g.snapToGrid(y, grid),
              embedding: embedding
          });
      }
docs: Drag Handlers