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

Function resolveEdge

src/native-ts/yoga-layout/index.ts:204–231  ·  view source on GitHub ↗
(
  edges: Value[],
  physicalEdge: number,
  ownerSize: number,
  // For margin/position we allow auto; for padding/border auto resolves to 0
  allowAuto = false,
)

Source from the content-addressed store, hash-verified

202const EDGE_BOTTOM = 3
203
204function resolveEdge(
205 edges: Value[],
206 physicalEdge: number,
207 ownerSize: number,
208 // For margin/position we allow auto; for padding/border auto resolves to 0
209 allowAuto = false,
210): number {
211 // Precedence: specific edge > horizontal/vertical > all
212 let v = edges[physicalEdge]!
213 if (v.unit === Unit.Undefined) {
214 if (physicalEdge === EDGE_LEFT || physicalEdge === EDGE_RIGHT) {
215 v = edges[Edge.Horizontal]!
216 } else {
217 v = edges[Edge.Vertical]!
218 }
219 }
220 if (v.unit === Unit.Undefined) {
221 v = edges[Edge.All]!
222 }
223 // Start/End map to Left/Right for LTR (Ink is always LTR)
224 if (v.unit === Unit.Undefined) {
225 if (physicalEdge === EDGE_LEFT) v = edges[Edge.Start]!
226 if (physicalEdge === EDGE_RIGHT) v = edges[Edge.End]!
227 }
228 if (v.unit === Unit.Undefined) return 0
229 if (v.unit === Unit.Auto) return allowAuto ? NaN : 0
230 return resolveValue(v, ownerSize)
231}
232
233function resolveEdgeRaw(edges: Value[], physicalEdge: number): Value {
234 let v = edges[physicalEdge]!

Callers 3

layoutNodeFunction · 0.85
layoutAbsoluteChildFunction · 0.85
childMarginForAxisFunction · 0.85

Calls 1

resolveValueFunction · 0.70

Tested by

no test coverage detected