mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 07:40:26 -08:00
fix Circle::intersectBbox
This commit is contained in:
@@ -45,7 +45,6 @@ export let DefaultActionsForContextMenu = (function () {
|
||||
const a = aladinInstance;
|
||||
|
||||
const selectObjects = (selection) => {
|
||||
console.log(selection)
|
||||
a.view.selectObjects(selection);
|
||||
};
|
||||
return [
|
||||
|
||||
@@ -251,7 +251,7 @@ export let Footprint= (function() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.shapes.some((shape) => shape.intersectsBBox(x, y, w, h, view));
|
||||
};
|
||||
|
||||
return Footprint;
|
||||
|
||||
@@ -135,10 +135,12 @@ export class Selector {
|
||||
}
|
||||
// footprints
|
||||
overlayItems = cat.getFootprints();
|
||||
|
||||
if (overlayItems) {
|
||||
const {x, y, w, h} = selection.bbox();
|
||||
for (var l = 0; l < overlayItems.length; l++) {
|
||||
f = overlayItems[l];
|
||||
|
||||
if (f.intersectsBBox(x, y, w, h, view)) {
|
||||
objListPerCatalog.push(f);
|
||||
}
|
||||
|
||||
@@ -328,9 +328,11 @@ export let Circle = (function() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// compute the absolute distance between the middle of the bbox
|
||||
// and the center of the circle
|
||||
const circleDistance = {
|
||||
x: Math.abs(centerXyview[0] - x),
|
||||
y: Math.abs(centerXyview[1] - y)
|
||||
x: Math.abs(centerXyview[0] - (x + w/2)),
|
||||
y: Math.abs(centerXyview[1] - (y + h/2))
|
||||
};
|
||||
|
||||
if (circleDistance.x > (w/2 + this.radius)) { return false; }
|
||||
|
||||
@@ -346,6 +346,7 @@ export let Ellipse = (function() {
|
||||
|
||||
Ellipse.prototype.intersectsBBox = function(x, y, w, h) {
|
||||
// todo
|
||||
return false;
|
||||
};
|
||||
|
||||
return Ellipse;
|
||||
|
||||
Reference in New Issue
Block a user