mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 15:49:18 -08:00
Fix issue with selection fillColor opacity
This commit is contained in:
committed by
Matthieu Baumann
parent
baa8f53349
commit
1f790a4b54
@@ -978,6 +978,7 @@ canvas {
|
||||
font-family: monospace;
|
||||
line-height: 1rem;
|
||||
|
||||
z-index: 100;
|
||||
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class CircleSelect extends FSM {
|
||||
|
||||
// draw the selection
|
||||
let colorValue = (typeof options.color === 'function') ? options.color(this.startCoo, this.coo) : options.color;
|
||||
ctx.fillStyle = colorValue;
|
||||
ctx.fillStyle = colorValue + '7f';
|
||||
ctx.strokeStyle = colorValue;
|
||||
ctx.lineWidth = options.lineWidth;
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ export class PolySelect extends FSM {
|
||||
e.stopPropagation();
|
||||
e.preventDefault()
|
||||
|
||||
btn.remove();
|
||||
self.dispatch('finish');
|
||||
}
|
||||
});
|
||||
@@ -125,7 +124,7 @@ export class PolySelect extends FSM {
|
||||
// draw the selection
|
||||
ctx.save();
|
||||
let colorValue = (typeof options.color === 'function') ? options.color() : options.color;
|
||||
ctx.fillStyle = colorValue;
|
||||
ctx.fillStyle = colorValue + '7f';
|
||||
ctx.strokeStyle = colorValue;
|
||||
ctx.lineWidth = options.lineWidth;
|
||||
|
||||
@@ -147,6 +146,7 @@ export class PolySelect extends FSM {
|
||||
}
|
||||
|
||||
let finish = () => {
|
||||
|
||||
if (this.coos.length <= 2) {
|
||||
console.warn("Invalid selection, please draw at least a 3 vertices polygon")
|
||||
|
||||
@@ -156,6 +156,10 @@ 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
|
||||
|
||||
@@ -60,7 +60,7 @@ export class RectSelect extends FSM {
|
||||
// draw the selection
|
||||
let colorValue = (typeof options.color === 'function') ? options.color(this.startCoo, this.coo) : options.color;
|
||||
|
||||
ctx.fillStyle = colorValue;
|
||||
ctx.fillStyle = colorValue + '7f';
|
||||
ctx.strokeStyle = colorValue;
|
||||
ctx.lineWidth = options.lineWidth;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user