single Host view refresh bug fix

This commit is contained in:
True Zhuanjia
2024-07-14 01:05:40 +08:00
parent 1b5f414c89
commit 01718282ff
4 changed files with 26 additions and 24 deletions
+1 -2
View File
@@ -14,8 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface NativeTouchHandler : UIResponder
@property (nonatomic, assign) bool XBoundaryReached;
@property (nonatomic, assign) bool YBoundaryReached;
@property (nonatomic, assign) bool BoundaryReached;
@property (nonatomic, assign) bool flipFlag;
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings;
+5 -3
View File
@@ -87,10 +87,12 @@
CGFloat normalizedY = location.y / videoSize.height;
uint8_t pointerId = [self retrievePointerIdFromDict:touch];
_XBoundaryReached = (normalizedX == 1.0f || normalizedX == 0.f);
_YBoundaryReached = (normalizedY == 1.0f || normalizedY == 0.f);
_BoundaryReached = (normalizedX == 1.0f || normalizedX == 0.f || normalizedY == 1.0f || normalizedY == 0.f);
//if(_XBoundaryReached || _YBoundaryReached) LiSendTouchEvent(LI_TOUCH_EVENT_UP,pointerId, normalizedX, normalizedY, 0, 0, 0, 0);
if(_XBoundaryReached || _YBoundaryReached) LiSendTouchEvent(LI_TOUCH_EVENT_UP,pointerId, normalizedX, normalizedY, 0, 0, 0, 0);
if(_BoundaryReached){
LiSendTouchEvent(LI_TOUCH_EVENT_UP, pointerId, normalizedX, normalizedY, 0, 0, 0, 0);
LiSendTouchEvent(LI_TOUCH_EVENT_MOVE, pointerId, 0.5, 0.5, 0, 0, 0, 0);
}
else LiSendTouchEvent(touchType, pointerId, normalizedX, normalizedY,(touch.force / touch.maximumPossibleForce) / sin(touch.altitudeAngle),0.0f, 0.0f,[streamView getRotationFromAzimuthAngle:[touch azimuthAngleInView:streamView]]);
}
+1 -2
View File
@@ -53,13 +53,12 @@ StreamView *streamView;
previousPoint = latestPoint;
latestPoint = [touch locationInView:streamView];
previousRelativePoint = latestRelativePoint;
if(nativeTouchHandler.XBoundaryReached || nativeTouchHandler.YBoundaryReached){ // reset
if(nativeTouchHandler.BoundaryReached){ // reset
previousRelativePoint.x = halfScreenWidthInPoints;
previousRelativePoint.y = halfScreenHeightInPoints;
}
latestRelativePoint.x = previousRelativePoint.x + pointerVelocityFactor * (latestPoint.x - previousPoint.x);
latestRelativePoint.y = previousRelativePoint.y + pointerVelocityFactor * (latestPoint.y - previousPoint.y);
}
+ (void)initContextWithView:(StreamView *)view andNativeTouchHandler:(NativeTouchHandler*)handler {