MCPcopy Create free account
hub / github.com/cogentcore/core / styleSplits

Method styleSplits

core/splits.go:634–660  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

632}
633
634func (sl *Splits) styleSplits() {
635 nt := len(sl.Tiles)
636 nh := nt - 1
637 for _, t := range sl.Tiles {
638 nh += tileNumElements[t] - 1
639 }
640 sl.handleDirs = slicesx.SetLength(sl.handleDirs, nh)
641 dir := sl.Styles.Direction
642 odir := dir.Other()
643 hi := nt - 1 // extra handles
644
645 for i, t := range sl.Tiles {
646 if i > 0 {
647 sl.handleDirs[i-1] = dir
648 }
649 switch t {
650 case TileSpan:
651 case TileSplit:
652 sl.handleDirs[hi] = odir
653 hi++
654 case TileFirstLong, TileSecondLong:
655 sl.handleDirs[hi] = odir
656 sl.handleDirs[hi+1] = dir
657 hi += 2
658 }
659 }
660}
661
662func (sl *Splits) SizeDownSetAllocs(iter int) {
663 if sl.NumChildren() <= 1 {

Callers 1

InitMethod · 0.95

Calls 2

SetLengthFunction · 0.92
OtherMethod · 0.45

Tested by

no test coverage detected