Sorting bands by low_band for in-order rendering.

This commit is contained in:
Marat Fayzullin 2024-06-02 19:19:23 -04:00
parent 626d796b32
commit 0a6225a13d
1 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,12 @@ Bandplan.prototype.getColor = function(type) {
}; };
Bandplan.prototype.update = function(bands) { Bandplan.prototype.update = function(bands) {
this.bands = bands; // Sort by low_bound for accurate rendering of overlapping bands
this.bands = bands.sort(function (a, b) {
return a.low_bound - b.low_bound;
});
// Draw new bands
this.draw(); this.draw();
}; };