MCPcopy Create free account
hub / github.com/material-shell/material-shell / getBorderForIndex

Method getBorderForIndex

src/layout/msWorkspace/portion.ts:275–313  ·  view source on GitHub ↗
(
        index: number,
        vertical = false,
        after = false
    )

Source from the content-addressed store, hash-verified

273 }
274
275 getBorderForIndex(
276 index: number,
277 vertical = false,
278 after = false
279 ): PortionBorder | undefined {
280 let portionIndex = 0;
281 const afterOffset = after ? 1 : 0;
282
283 if (index >= this.portionLength) {
284 return;
285 }
286
287 for (let i = 0; i < this.children.length; i++) {
288 const portion = this.children[i];
289
290 if (portionIndex === index) {
291 if (i - afterOffset < 0) {
292 return;
293 }
294 }
295
296 if (portion.portionLength + portionIndex > index) {
297 if (
298 this.vertical === vertical &&
299 !portion.isBorderInSubPortion(index - portionIndex, after)
300 ) {
301 return this.borders[i - afterOffset];
302 }
303
304 return portion.getBorderForIndex(
305 index - portionIndex,
306 vertical,
307 after
308 );
309 }
310
311 portionIndex += portion.portionLength;
312 }
313 }
314
315 getRatioForIndex(
316 index: number,

Callers 1

getTileableBorderMethod · 0.80

Calls 1

isBorderInSubPortionMethod · 0.80

Tested by

no test coverage detected