mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 15:49:18 -08:00
Allow color as function for select types
This commit is contained in:
committed by
Matthieu Baumann
parent
00c9d6ffc5
commit
5410544404
@@ -57,8 +57,9 @@ export class CircleSelect extends FSM {
|
|||||||
let ctx = view.catalogCtx;
|
let ctx = view.catalogCtx;
|
||||||
|
|
||||||
// draw the selection
|
// draw the selection
|
||||||
ctx.fillStyle = options.color + '7f';
|
let colorValue = (typeof options.color === 'function') ? options.color(this.startCoo, this.coo) : options.color;
|
||||||
ctx.strokeStyle = options.color;
|
ctx.fillStyle = colorValue;
|
||||||
|
ctx.strokeStyle = colorValue;
|
||||||
ctx.lineWidth = options.lineWidth;
|
ctx.lineWidth = options.lineWidth;
|
||||||
|
|
||||||
var r2 = (this.coo.x - this.startCoo.x) * (this.coo.x - this.startCoo.x) + (this.coo.y - this.startCoo.y) * (this.coo.y - this.startCoo.y);
|
var r2 = (this.coo.x - this.startCoo.x) * (this.coo.x - this.startCoo.x) + (this.coo.y - this.startCoo.y) * (this.coo.y - this.startCoo.y);
|
||||||
|
|||||||
@@ -121,11 +121,12 @@ export class PolySelect extends FSM {
|
|||||||
|
|
||||||
let draw = () => {
|
let draw = () => {
|
||||||
let ctx = view.catalogCtx;
|
let ctx = view.catalogCtx;
|
||||||
|
|
||||||
// draw the selection
|
// draw the selection
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.fillStyle = options.color + '7f';
|
let colorValue = (typeof options.color === 'function') ? options.color() : options.color;
|
||||||
ctx.strokeStyle = options.color;
|
ctx.fillStyle = colorValue;
|
||||||
|
ctx.strokeStyle = colorValue;
|
||||||
ctx.lineWidth = options.lineWidth;
|
ctx.lineWidth = options.lineWidth;
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|||||||
@@ -58,8 +58,10 @@ export class RectSelect extends FSM {
|
|||||||
let ctx = view.catalogCtx;
|
let ctx = view.catalogCtx;
|
||||||
|
|
||||||
// draw the selection
|
// draw the selection
|
||||||
ctx.fillStyle = options.color + '7f';
|
let colorValue = (typeof options.color === 'function') ? options.color(this.startCoo, this.coo) : options.color;
|
||||||
ctx.strokeStyle = options.color;
|
|
||||||
|
ctx.fillStyle = colorValue;
|
||||||
|
ctx.strokeStyle = colorValue;
|
||||||
ctx.lineWidth = options.lineWidth;
|
ctx.lineWidth = options.lineWidth;
|
||||||
|
|
||||||
var w = this.coo.x - this.startCoo.x;
|
var w = this.coo.x - this.startCoo.x;
|
||||||
|
|||||||
Reference in New Issue
Block a user