Show first unstable element in autopilot
Skips all unstable elements in autopilot
This commit is contained in:
parent
de474e9eae
commit
22a318bde2
@ -95,6 +95,18 @@ export class Projector extends BaseModel<Projector> {
|
||||
return [this.aspect_ratio_numerator, this.aspect_ratio_denominator].join(':');
|
||||
}
|
||||
|
||||
public get firstUnstableElement(): ProjectorElement {
|
||||
let elementIndex = 0;
|
||||
/**
|
||||
* while we could use a filter function to remove all stable elements, I expect
|
||||
* this approach to be the fastest
|
||||
*/
|
||||
while (!!this.elements[elementIndex]?.stable) {
|
||||
elementIndex++;
|
||||
}
|
||||
return this.elements[elementIndex] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the aspect ratio
|
||||
*/
|
||||
|
@ -96,7 +96,7 @@ export class CinemaComponent extends BaseViewComponentDirective implements OnIni
|
||||
this.subscriptions.push(
|
||||
this.projectorRepo.getReferenceProjectorObservable().subscribe(refProjector => {
|
||||
this.projector = refProjector;
|
||||
this.currentProjectorElement = refProjector?.elements[0] || null;
|
||||
this.currentProjectorElement = refProjector?.firstUnstableElement || null;
|
||||
if (this.currentProjectorElement) {
|
||||
this.projectedViewModel = this.projectorService.getViewModelFromProjectorElement(
|
||||
this.currentProjectorElement
|
||||
|
Loading…
Reference in New Issue
Block a user