mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 15:49:18 -08:00
prefer drawing the hover color over the selection color
This commit is contained in:
committed by
Matthieu Baumann
parent
f1a1247a43
commit
8b8c1460eb
@@ -11,7 +11,7 @@
|
|||||||
let aladin;
|
let aladin;
|
||||||
A.init.then(() => {
|
A.init.then(() => {
|
||||||
aladin = A.aladin('#aladin-lite-div', {target: 'LMC', fov: 55, showContextMenu: true});
|
aladin = A.aladin('#aladin-lite-div', {target: 'LMC', fov: 55, showContextMenu: true});
|
||||||
var hips = A.catalogHiPS('https://axel.u-strasbg.fr/HiPSCatService/Simbad', {onClick: 'showPopup', name: 'Simbad'});
|
var hips = A.catalogHiPS('https://axel.u-strasbg.fr/HiPSCatService/Simbad', {hoverColor: 'yellow', onClick: 'showPopup', name: 'Simbad'});
|
||||||
aladin.addCatalog(hips);
|
aladin.addCatalog(hips);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -736,12 +736,12 @@ export let Catalog = (function() {
|
|||||||
else if (s.marker && s.useMarkerDefaultIcon) {
|
else if (s.marker && s.useMarkerDefaultIcon) {
|
||||||
ctx.drawImage(this.cacheMarkerCanvas, s.x-this.sourceSize/2, s.y-this.sourceSize/2);
|
ctx.drawImage(this.cacheMarkerCanvas, s.x-this.sourceSize/2, s.y-this.sourceSize/2);
|
||||||
}
|
}
|
||||||
else if (s.isSelected) {
|
|
||||||
ctx.drawImage(this.cacheSelectCanvas, s.x-this.selectSize/2, s.y-this.selectSize/2);
|
|
||||||
}
|
|
||||||
else if (s.isHovered) {
|
else if (s.isHovered) {
|
||||||
ctx.drawImage(this.cacheHoverCanvas, s.x-this.selectSize/2, s.y-this.selectSize/2);
|
ctx.drawImage(this.cacheHoverCanvas, s.x-this.selectSize/2, s.y-this.selectSize/2);
|
||||||
}
|
}
|
||||||
|
else if (s.isSelected) {
|
||||||
|
ctx.drawImage(this.cacheSelectCanvas, s.x-this.selectSize/2, s.y-this.selectSize/2);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
ctx.drawImage(this.cacheCanvas, s.x-this.cacheCanvas.width/2, s.y-this.cacheCanvas.height/2);
|
ctx.drawImage(this.cacheCanvas, s.x-this.cacheCanvas.width/2, s.y-this.cacheCanvas.height/2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1007,11 +1007,6 @@ export let View = (function () {
|
|||||||
view.setCursor('default');
|
view.setCursor('default');
|
||||||
var objHoveredStopFunction = view.aladin.callbacksByEventName['objectHoveredStop'];
|
var objHoveredStopFunction = view.aladin.callbacksByEventName['objectHoveredStop'];
|
||||||
if (lastHoveredObject) {
|
if (lastHoveredObject) {
|
||||||
// Redraw the scene if the lastHoveredObject is a footprint (e.g. circle or polygon)
|
|
||||||
//if (lastHoveredObject.isFootprint()) {
|
|
||||||
// view.requestRedraw();
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (typeof objHoveredStopFunction === 'function') {
|
if (typeof objHoveredStopFunction === 'function') {
|
||||||
// call callback function to notify we left the hovered object
|
// call callback function to notify we left the hovered object
|
||||||
var ret = objHoveredStopFunction(lastHoveredObject, xymouse);
|
var ret = objHoveredStopFunction(lastHoveredObject, xymouse);
|
||||||
|
|||||||
Reference in New Issue
Block a user