Skip to content

Commit

Permalink
fix absolute positioning breaking scroll origin
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-hackin committed May 7, 2015
1 parent a0bea01 commit 52514e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

// run initializer
applyZpd();
paper.attr('style', "postion:absolute; top:300px; left:300px");


// UI improvement needed
Expand Down
4 changes: 2 additions & 2 deletions snap.svg.zpd.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@

var p = svgNode.node.createSVGPoint();

p.x = event.clientX;
p.y = event.clientY;
p.x = event.clientX - parseFloat(window.getComputedStyle(svgNode.node,null).getPropertyValue('left'));
p.y = event.clientY - parseFloat(window.getComputedStyle(svgNode.node,null).getPropertyValue('top'));

return p;
};
Expand Down

0 comments on commit 52514e4

Please sign in to comment.