diff --git a/Sources/OpenSwiftUICore/Layout/Alignment/AlignmentGuide.swift b/Sources/OpenSwiftUICore/Layout/Alignment/AlignmentGuide.swift index 0dae8a3c5..4428407be 100644 --- a/Sources/OpenSwiftUICore/Layout/Alignment/AlignmentGuide.swift +++ b/Sources/OpenSwiftUICore/Layout/Alignment/AlignmentGuide.swift @@ -1241,7 +1241,7 @@ public struct AlignmentKey: Hashable, Comparable { package var axis: Axis { bits & 1 == 0 ? .horizontal : .vertical } @inline(__always) - var index: Int { Int(bits / 2 - 1) } + var index: Int { Int((bits - 2) >> 1) } package init(id: any AlignmentID.Type, axis: Axis) { let index = Self.$typeCache.access { cache in @@ -1255,7 +1255,7 @@ public struct AlignmentKey: Hashable, Comparable { return index } } - bits = (axis == .horizontal ? 0 : 1) + (index + 1) * 2 + bits = ((index << 1) | (axis == .horizontal ? 0 : 1)) &+ 2 } package init() { bits = .zero }