prefer drawing the hover color over the selection color

This commit is contained in:
Matthieu Baumann
2024-03-27 23:44:23 +01:00
committed by Matthieu Baumann
parent f1a1247a43
commit 8b8c1460eb
3 changed files with 4 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
let aladin;
A.init.then(() => {
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);
});
</script>

View File

@@ -736,12 +736,12 @@ export let Catalog = (function() {
else if (s.marker && s.useMarkerDefaultIcon) {
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) {
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 {
ctx.drawImage(this.cacheCanvas, s.x-this.cacheCanvas.width/2, s.y-this.cacheCanvas.height/2);
}

View File

@@ -1007,11 +1007,6 @@ export let View = (function () {
view.setCursor('default');
var objHoveredStopFunction = view.aladin.callbacksByEventName['objectHoveredStop'];
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') {
// call callback function to notify we left the hovered object
var ret = objHoveredStopFunction(lastHoveredObject, xymouse);