forked from Blendman974/faceclaw
Migrate things into new UI design
This commit is contained in:
1 parent
1133f952e9
commit
68ab599856
21 files changed
+1262
-602
No files matched your search
@@ -75,6 +75,11 @@ export class LayerStack {
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether the top layer matches (without popping it). */
|
||||
topMatches(predicate: (layer: Layer) => boolean): boolean {
|
||||
return this.layers.length > 1 && predicate(this.layers[this.layers.length - 1]!);
|
||||
}
|
||||
|
||||
/** Pop the top layer only if it matches; returns whether a layer was popped. */
|
||||
popIfTop(predicate: (layer: Layer) => boolean): boolean {
|
||||
if (this.layers.length > 1 && predicate(this.layers[this.layers.length - 1]!)) {
|
||||
@@ -94,6 +99,10 @@ export class LayerStack {
|
||||
return this.layers.length === 1;
|
||||
}
|
||||
|
||||
getBaseSize(): { width: number; height: number } {
|
||||
return { width: this.baseWidth, height: this.baseHeight };
|
||||
}
|
||||
|
||||
setActions(actions: Partial<LayerActions>): void {
|
||||
Object.assign(this.ctx.actions, actions);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user