Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use getBoundingClientRect() to determine local mouse location

  • Loading branch information...
commit fd6022c5c09804789254f1dd9c48553df329b5ad 1 parent c98a2b3
Tom Preston-Werner authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 primer.js
5 primer.js
View
@@ -31,8 +31,9 @@ Primer.prototype = {
var self = this
jelc.eq(0).mousemove(function(e) {
- e.localX = e.clientX - elc.offsetLeft
- e.localY = e.clientY - elc.offsetTop
+ var bounds = e.currentTarget.getBoundingClientRect()
+ e.localX = e.clientX - bounds.left
+ e.localY = e.clientY - bounds.top
self.ghost(e)
})
},
Please sign in to comment.
Something went wrong with that request. Please try again.