fix null relative coordinate when pointerVelocityfactor is 100%
This commit is contained in:
1 parent
873269e410
commit
5c88787401
2 files changed
+11
-13
No files matched your search
@@ -54,13 +54,11 @@ StreamView *streamView;
|
||||
- (void)updatePointerCoords:(UITouch *)touch{
|
||||
previousPoint = latestPoint;
|
||||
latestPoint = [touch locationInView:streamView];
|
||||
if (pointerVelocityFactor != 1.0f){
|
||||
velocityX = latestPoint.x - previousPoint.x;
|
||||
velocityY = latestPoint.y - previousPoint.y;
|
||||
previousRelativePoint = latestRelativePoint;
|
||||
latestRelativePoint.x = previousRelativePoint.x + pointerVelocityFactor * velocityX;
|
||||
latestRelativePoint.y = previousRelativePoint.y + pointerVelocityFactor * velocityY;
|
||||
}
|
||||
velocityX = latestPoint.x - previousPoint.x;
|
||||
velocityY = latestPoint.y - previousPoint.y;
|
||||
previousRelativePoint = latestRelativePoint;
|
||||
latestRelativePoint.x = previousRelativePoint.x + pointerVelocityFactor * velocityX;
|
||||
latestRelativePoint.y = previousRelativePoint.y + pointerVelocityFactor * velocityY;
|
||||
}
|
||||
|
||||
+ (void)initContextWith:(StreamView *)view{
|
||||
|
||||
Reference in new issue
Block a user