mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 15:49:18 -08:00
Add line dash option to Overlay class
This commit is contained in:
committed by
Matthieu Baumann
parent
fade1f95d2
commit
fea04ae118
@@ -46,6 +46,7 @@ export let Overlay = (function() {
|
||||
this.color = options.color || Color.getNextColor();
|
||||
|
||||
this.lineWidth = options["lineWidth"] || 2;
|
||||
this.lineDash = options["lineDash"] || [];
|
||||
|
||||
//this.indexationNorder = 5; // at which level should we index overlays?
|
||||
//this.overlays = [];
|
||||
@@ -204,6 +205,7 @@ export let Overlay = (function() {
|
||||
// simple drawing
|
||||
ctx.strokeStyle= this.color;
|
||||
ctx.lineWidth = this.lineWidth;
|
||||
ctx.setLineDash(this.lineDash);
|
||||
|
||||
// 1. Drawing polygons
|
||||
|
||||
@@ -262,6 +264,11 @@ export let Overlay = (function() {
|
||||
this.reportChange();
|
||||
};
|
||||
|
||||
Overlay.prototype.setLineDash = function(lineDash) {
|
||||
this.lineDash = lineDash;
|
||||
this.reportChange();
|
||||
}
|
||||
|
||||
// callback function to be called when the status of one of the footprints has changed
|
||||
Overlay.prototype.reportChange = function() {
|
||||
this.view && this.view.requestRedraw();
|
||||
|
||||
Reference in New Issue
Block a user