Fix selecting another background layer in minimaps

This commit is contained in:
Pieter Vander Vennet 2021-11-30 18:10:46 +01:00
parent 3f37848022
commit 6e9d4b327e
3 changed files with 15 additions and 4 deletions

View file

@ -11,6 +11,10 @@ export class UIEventSource<T> {
constructor(data: T, tag: string = "") {
this.tag = tag;
this.data = data;
if(tag === undefined || tag === ""){
const callstack = new Error().stack.split("\n")
this.tag = callstack[1]
}
UIEventSource.allSources.push(this);
}
@ -278,9 +282,11 @@ export class UIEventSource<T> {
g: ((j: J, t: T) => T) = undefined): UIEventSource<J> {
const self = this;
const stack = new Error().stack.split("\n");
const callee = stack[1]
const newSource = new UIEventSource<J>(
f(this.data),
"map(" + this.tag + ")"
"map(" + this.tag + ")@"+callee
);
const update = function () {