public _computeSizes()

in desktop/src/@batch-flask/ui/split-pane/split-pane.component.ts [104:147]


    public _computeSizes() {
        if (this.config.firstPane.hidden) {
            this.firstPaneSize = "0px";
            this.secondPaneSize = "100%";
            return;
        } else if (this.config.secondPane.hidden) {
            this.firstPaneSize = "100%";
            this.secondPaneSize = "0px";
            return;
        }

        const rect = this.elementRef.nativeElement.getBoundingClientRect();

        const result = this._getDividerPosision();
        let dividerPosition = result.dividerPosition;
        const fromEnd = result.fromEnd;

        if (dividerPosition === null) {
            this.firstPaneSize = "50%";
            this.secondPaneSize = "50%";
        } else {
            let { firstPane, secondPane } = this.config;
            if (rect.width !== 0) { // When initialized
                if (fromEnd) {
                    [firstPane, secondPane] = [secondPane, firstPane];
                }
                if (dividerPosition > rect.width - secondPane.minSize) {
                    dividerPosition = rect.width - secondPane.minSize;
                }
                if (dividerPosition < firstPane.minSize) {
                    dividerPosition = firstPane.minSize;
                }
            }
            if (fromEnd) {
                this.firstPaneSize = `calc(100% - ${dividerPosition  + this.config.separatorThickness}px)`;
                this.secondPaneSize = `${dividerPosition}px`;
            } else {
                this.firstPaneSize = `${dividerPosition}px`;
                this.secondPaneSize = `calc(100% - ${dividerPosition + this.config.separatorThickness}px)`;

            }
        }
        this.changeDetector.markForCheck();
    }