Skip to content

Commit

Permalink
iOS: Fix for Multitouch on iOS 16.4 SDK (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 authored May 3, 2023
1 parent e205144 commit 0510a48
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions platform/iphone/CoronaViewPrivate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,12 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
if ( fInhibitCount > 0 ) { return; }

UITouch *touch = touches.anyObject;
CGPoint currentTouchPosition;
#ifdef Rtt_TVOS_ENV
CGPoint currentTouchPosition = { [touch locationInView:self].x - [self center].x, [touch locationInView:self].y - [self center].y };
#else
CGPoint currentTouchPosition = [touch locationInCoronaView:self];
#endif


#ifdef Rtt_MULTITOUCH
if ( self.multipleTouchEnabled )
Expand All @@ -1091,10 +1096,8 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
#endif
{
#ifdef Rtt_TVOS_ENV
currentTouchPosition = { [touch locationInView:self].x - [self center].x, [touch locationInView:self].y - [self center].y };
Rtt::RelativeTouchEvent t( currentTouchPosition.x, currentTouchPosition.y, Rtt::TouchEvent::kMoved );
#else
currentTouchPosition = [touch locationInCoronaView:self];
Rtt::Real pressure = [CoronaView getTouchForce:touch];
Rtt::TouchEvent t( currentTouchPosition.x, currentTouchPosition.y, fStartTouchPosition.x, fStartTouchPosition.y, Rtt::TouchEvent::kMoved, pressure );
#endif
Expand Down

0 comments on commit 0510a48

Please sign in to comment.