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

Method Position

core/layout.go:1639–1655  ·  view source on GitHub ↗

Position: uses the final sizes to position everything within layouts according to alignment settings.

()

Source from the content-addressed store, hash-verified

1637// Position: uses the final sizes to position everything within layouts
1638// according to alignment settings.
1639func (fr *Frame) Position() {
1640 if !fr.HasChildren() || !fr.layout.shapeCheck(fr, "Position") {
1641 fr.WidgetBase.Position() // behave like a widget
1642 return
1643 }
1644 if fr.Parent == nil {
1645 fr.positionWithinAllocMainY(math32.Vector2{}, fr.Styles.Justify.Items, fr.Styles.Align.Items)
1646 }
1647 fr.ConfigScrolls() // and configure the scrolls
1648 if fr.Styles.Display == styles.Stacked {
1649 fr.positionStacked()
1650 } else {
1651 fr.positionCells()
1652 fr.positionChildren()
1653 }
1654 fr.positionParts()
1655}
1656
1657func (fr *Frame) positionCells() {
1658 if fr.Styles.Display == styles.Flex && fr.Styles.Direction == styles.Column {

Callers

nothing calls this directly

Calls 9

ConfigScrollsMethod · 0.95
positionStackedMethod · 0.95
positionCellsMethod · 0.95
shapeCheckMethod · 0.80
positionChildrenMethod · 0.80
positionPartsMethod · 0.80
PositionMethod · 0.65
HasChildrenMethod · 0.45

Tested by

no test coverage detected