diff --git a/src/css/aladin.css b/src/css/aladin.css index f51430ff..ce01750e 100644 --- a/src/css/aladin.css +++ b/src/css/aladin.css @@ -978,7 +978,7 @@ canvas { font-family: monospace; line-height: 1rem; - z-index: 100; + /*z-index: 100;*/ float: left; } diff --git a/src/js/DefaultActionsForContextMenu.js b/src/js/DefaultActionsForContextMenu.js index a6a8b8ca..a136bce2 100644 --- a/src/js/DefaultActionsForContextMenu.js +++ b/src/js/DefaultActionsForContextMenu.js @@ -206,6 +206,12 @@ export let DefaultActionsForContextMenu = (function () { action(o) { a.select('rect', selectObjects) } + }, + { + label: 'Polygon', + action(o) { + a.select('poly', selectObjects) + } } ] }, diff --git a/src/js/FiniteStateMachine/PolySelect.js b/src/js/FiniteStateMachine/PolySelect.js index fa89b328..d5c4a52a 100644 --- a/src/js/FiniteStateMachine/PolySelect.js +++ b/src/js/FiniteStateMachine/PolySelect.js @@ -71,7 +71,6 @@ export class PolySelect extends FSM { this.callback = callback; // reset the coo this.coos = []; - } let click = (params) => { @@ -146,6 +145,9 @@ export class PolySelect extends FSM { } let finish = () => { + if(btn) { + btn.remove(); + } if (this.coos.length <= 2) { console.warn("Invalid selection, please draw at least a 3 vertices polygon") @@ -156,10 +158,6 @@ export class PolySelect extends FSM { return; } - if(btn) { - btn.remove(); - } - // finish the selection let xMin = this.coos[0].x let yMin = this.coos[0].y