Skip to content

Commit

Permalink
Merge pull request #21 from maxxfrazer/fix-ios-17-disappear
Browse files Browse the repository at this point in the history
Invalid Rotations
  • Loading branch information
maxxfrazer committed Nov 14, 2023
2 parents 041d7a9 + bbe0f36 commit 464cc8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/RealityUI/RUIButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ internal extension HasButton {
self.isCompressed = true
innerModel.stopAllAnimations()
innerModel.move(
to: Transform(scale: .one, rotation: .init(), translation: self.buttonInPos),
to: Transform(scale: .one, rotation: .init(angle: 0, axis: [0, 1, 0]), translation: self.buttonInPos),
relativeTo: self, duration: 0.15
)
}
Expand All @@ -309,7 +309,7 @@ internal extension HasButton {
self.isCompressed = false
innerModel.stopAllAnimations()
innerModel.move(
to: Transform(scale: .one, rotation: .init(), translation: self.buttonOutPos),
to: Transform(scale: .one, rotation: .init(angle: 0, axis: [0, 1, 0]), translation: self.buttonOutPos),
relativeTo: self, duration: 0.15
)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/RealityUI/RUIStepper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class RUIStepper: Entity, HasRUIMaterials, HasStepper {
public func arTouchUpdated(at worldCoordinate: SIMD3<Float>, hasCollided: Bool) {
let localPos = self.convert(position: worldCoordinate, from: nil)
let touchingObj: StepperComponent.UIPart = localPos.x > 0 ? .left : .right
if self.isCompressed, (!hasCollided || touchingObj != buttonStarted) {
if self.isCompressed, !hasCollided || touchingObj != buttonStarted {
self.compressButton(compress: false)
} else if !self.isCompressed, hasCollided, touchingObj == buttonStarted {
self.compressButton()
Expand Down
2 changes: 1 addition & 1 deletion Sources/RealityUI/RUISwitch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public extension HasSwitch {

self.getModel(part: .background)?.model?.materials = self.getMaterials(for: .background)
let thumbTransform = Transform(
scale: .one, rotation: .init(), translation: togglePos
scale: .one, rotation: .init(angle: 0, axis: [0, 1, 0]), translation: togglePos
)
let thumbEntity = self.getModel(part: .thumb)
thumbEntity?.stopAllAnimations()
Expand Down

0 comments on commit 464cc8d

Please sign in to comment.