Skip to content

Commit

Permalink
expose mouse coords in callbacks for source/footprint click and hover
Browse files Browse the repository at this point in the history
  • Loading branch information
szpetny authored and bmatthieu3 committed Sep 20, 2023
1 parent 7a52a9f commit 01aff09
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/js/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,13 +708,13 @@ export let View = (function () {
}

var objClickedFunction = view.aladin.callbacksByEventName['objectClicked'];
(typeof objClickedFunction === 'function') && objClickedFunction(o);
(typeof objClickedFunction === 'function') && objClickedFunction(o, xymouse);


if (o.isFootprint()) {
var footprintClickedFunction = view.aladin.callbacksByEventName['footprintClicked'];
if (typeof footprintClickedFunction === 'function' && o != view.lastClickedObject) {
var ret = footprintClickedFunction(o);
var ret = footprintClickedFunction(o, xymouse);
}
}

Expand All @@ -738,7 +738,7 @@ export let View = (function () {
}

var objClickedFunction = view.aladin.callbacksByEventName['objectClicked'];
(typeof objClickedFunction === 'function') && objClickedFunction(null);
(typeof objClickedFunction === 'function') && objClickedFunction(null, xymouse);

view.lastClickedObject = null;
}
Expand Down Expand Up @@ -867,12 +867,12 @@ export let View = (function () {

view.setCursor('pointer');
if (typeof objHoveredFunction === 'function' && o != lastHoveredObject) {
var ret = objHoveredFunction(o);
var ret = objHoveredFunction(o, xymouse);
}

if (o.isFootprint()) {
if (typeof footprintHoveredFunction === 'function' && o != lastHoveredObject) {
var ret = footprintHoveredFunction(o);
var ret = footprintHoveredFunction(o, xymouse);
}
}

Expand All @@ -888,7 +888,7 @@ export let View = (function () {

if (typeof objHoveredStopFunction === 'function') {
// call callback function to notify we left the hovered object
var ret = objHoveredStopFunction(lastHoveredObject);
var ret = objHoveredStopFunction(lastHoveredObject, xymouse);
}
}

Expand Down

0 comments on commit 01aff09

Please sign in to comment.