MCPcopy Index your code
hub / github.com/csev/py4e / posFromMouse

Function posFromMouse

tools/pythonauto/static/codemirror/codemirror.js:1707–1719  ·  view source on GitHub ↗
(cm, e, liberal)

Source from the content-addressed store, hash-verified

1705 }
1706
1707 function posFromMouse(cm, e, liberal) {
1708 var display = cm.display;
1709 if (!liberal) {
1710 var target = e_target(e);
1711 if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
1712 target == display.scrollbarV || target == display.scrollbarV.firstChild ||
1713 target == display.scrollbarFiller || target == display.gutterFiller) return null;
1714 }
1715 var x, y, space = getRect(display.lineSpace);
1716 // Fails unpredictably on IE[67] when mouse is dragged around quickly.
1717 try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
1718 return coordsChar(cm, x - space.left, y - space.top);
1719 }
1720
1721 var lastClick, lastDoubleClick;
1722 function onMouseDown(e) {

Callers 5

registerEventHandlersFunction · 0.70
onMouseDownFunction · 0.70
extendFunction · 0.70
onDropFunction · 0.70
onContextMenuFunction · 0.70

Calls 3

getRectFunction · 0.85
e_targetFunction · 0.70
coordsCharFunction · 0.70

Tested by

no test coverage detected