hakimel / Fokus

MIT License
625 stars 87 forks source link

CSS Transform Support #6

Open yocontra opened 11 years ago

yocontra commented 11 years ago

I'm using isotope so the actual position of the element before the transform is in the upper left corner. When I select the text on the element after the transform the highlight appears in the upper left corner even though on-screen the element is somewhere else.

yocontra commented 11 years ago

Tinkered and replacing getScreenPosition with this

function getScreenPosition( node ) {
    var rect = node.getBoundingClientRect();
    return { x: rect.left, y: rect.bottom-rect.height };
  }

seemed to fix the problem.