MCPcopy Create free account
hub / github.com/codeaashu/claude-code / alignAbsolute

Function alignAbsolute

src/native-ts/yoga-layout/index.ts:2039–2057  ·  view source on GitHub ↗
(
  align: Align,
  leadEdge: number,
  trailEdge: number,
  childSize: number,
  wrapReverse: boolean,
)

Source from the content-addressed store, hash-verified

2037}
2038
2039function alignAbsolute(
2040 align: Align,
2041 leadEdge: number,
2042 trailEdge: number,
2043 childSize: number,
2044 wrapReverse: boolean,
2045): number {
2046 // Wrap-reverse flips the cross axis: flex-start/stretch go to trailing,
2047 // flex-end goes to leading (yoga's absoluteLayoutChild flips the align value
2048 // when the containing block has wrap-reverse).
2049 switch (align) {
2050 case Align.Center:
2051 return leadEdge + (trailEdge - leadEdge - childSize) / 2
2052 case Align.FlexEnd:
2053 return wrapReverse ? leadEdge : trailEdge - childSize
2054 default:
2055 return wrapReverse ? trailEdge - childSize : leadEdge
2056 }
2057}
2058
2059function computeFlexBasis(
2060 child: Node,

Callers 1

layoutAbsoluteChildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected