Skip to content

Commit

Permalink
round panning #24
Browse files Browse the repository at this point in the history
  • Loading branch information
forresto committed Oct 30, 2013
1 parent 6ef5175 commit 5342ee1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions the-graph/the-graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,13 @@
this._pan.y = Math.round(pan.y);
this.pan = this._pan.x + ' ' + this._pan.y;

console.log(pan,this._pan);

var bump = this.calcBump();

var info = {
pan: pan,
bump: bump,
pan: this._pan,
bump: bump,
zoom: this.zoom
};
this.$.nodes.graphBumped(info);
Expand Down Expand Up @@ -296,8 +298,8 @@
var oX = (currentX - pageX) * scaleD + pageX;
var oY = (currentY - pageY) * scaleD + pageY;
// To be corrected later
this.scalePanD.x = oX + this.bump.x*scaleD;
this.scalePanD.y = oY + this.bump.y*scaleD;
this.scalePanD.x = Math.round(oX + this.bump.x*scaleD);
this.scalePanD.y = Math.round(oY + this.bump.y*scaleD);

theGraph.transform(this, oX, oY, scaleD);

Expand Down

0 comments on commit 5342ee1

Please sign in to comment.