Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/OpenSwiftUICore/Layout/Alignment/AlignmentGuide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }
Expand Down
Loading