fix pointerVelocityDivider bug
This commit is contained in:
commit
c9f4113534
2 files changed
+7
-5
No files matched your search
@@ -18,8 +18,8 @@ static NSMutableDictionary *pointerIdDict; //pointerId Dict for native touch.
|
|||||||
static NSMutableSet<NSNumber *> *pointerIdSet; //pointerIdSet for native touch.
|
static NSMutableSet<NSNumber *> *pointerIdSet; //pointerIdSet for native touch.
|
||||||
static NSMutableDictionary *pointerDict;
|
static NSMutableDictionary *pointerDict;
|
||||||
|
|
||||||
static CGFloat pointerVelocityFactor = 0.7;
|
static CGFloat pointerVelocityFactor;
|
||||||
static CGFloat pointerVelocityDivider = 0.5;
|
static CGFloat pointerVelocityDivider;
|
||||||
static CGFloat pointerVelocityDividerLocation;
|
static CGFloat pointerVelocityDividerLocation;
|
||||||
|
|
||||||
StreamView *streamView;
|
StreamView *streamView;
|
||||||
@@ -68,7 +68,9 @@ StreamView *streamView;
|
|||||||
pointerIdDict = [NSMutableDictionary dictionary];
|
pointerIdDict = [NSMutableDictionary dictionary];
|
||||||
pointerIdSet = [NSMutableSet set];
|
pointerIdSet = [NSMutableSet set];
|
||||||
pointerDict = [NSMutableDictionary dictionary];
|
pointerDict = [NSMutableDictionary dictionary];
|
||||||
pointerVelocityDividerLocation = CGRectGetHeight([[UIScreen mainScreen] bounds]) * pointerVelocityDivider;
|
pointerVelocityDividerLocation = CGRectGetWidth([[UIScreen mainScreen] bounds]) * pointerVelocityDivider;
|
||||||
|
NSLog(@"pointerVelocityDivider: %.2f", pointerVelocityDivider);
|
||||||
|
NSLog(@"pointerVelocityDividerLocation: %.2f", pointerVelocityDividerLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)populatePointerObjIntoDict:(UITouch*)touch{
|
+ (void)populatePointerObjIntoDict:(UITouch*)touch{
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
self->streamAspectRatio = (float)streamConfig.width / (float)streamConfig.height;
|
self->streamAspectRatio = (float)streamConfig.width / (float)streamConfig.height;
|
||||||
|
|
||||||
settings = [[[DataManager alloc] init] getSettings];
|
settings = [[[DataManager alloc] init] getSettings];
|
||||||
[TouchPointer initContextWith:self];
|
|
||||||
[TouchPointer setPointerVelocityDivider:settings.pointerVelocityModeDivider.floatValue];
|
[TouchPointer setPointerVelocityDivider:settings.pointerVelocityModeDivider.floatValue];
|
||||||
[TouchPointer setPointerVelocityFactor:settings.touchPointerVelocityFactor.floatValue];
|
[TouchPointer setPointerVelocityFactor:settings.touchPointerVelocityFactor.floatValue];
|
||||||
|
[TouchPointer initContextWith:self];
|
||||||
|
|
||||||
keysDown = [[NSMutableSet alloc] init];
|
keysDown = [[NSMutableSet alloc] init];
|
||||||
keyInputField = [[KeyboardInputField alloc] initWithFrame:CGRectZero];
|
keyInputField = [[KeyboardInputField alloc] initWithFrame:CGRectZero];
|
||||||
@@ -335,7 +335,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
|
|
||||||
- (void)sendTouchEvent:(UITouch*)event touchType:(uint8_t)touchType{
|
- (void)sendTouchEvent:(UITouch*)event touchType:(uint8_t)touchType{
|
||||||
CGPoint targetCoords;
|
CGPoint targetCoords;
|
||||||
if(settings.pointerVelocityModeDivider.floatValue != 1.0) targetCoords = [TouchPointer selectCoordsFor:event]; // coordinates of touch pointer replaced to relative ones here.
|
if(settings.pointerVelocityModeDivider.floatValue != 1.0 && event.phase == UITouchPhaseMoved) targetCoords = [TouchPointer selectCoordsFor:event]; // coordinates of touch pointer replaced to relative ones here.
|
||||||
else targetCoords = [event locationInView:self];
|
else targetCoords = [event locationInView:self];
|
||||||
CGPoint location = [self adjustCoordinatesForVideoArea:targetCoords];
|
CGPoint location = [self adjustCoordinatesForVideoArea:targetCoords];
|
||||||
CGSize videoSize = [self getVideoAreaSize];
|
CGSize videoSize = [self getVideoAreaSize];
|
||||||
|
|||||||
Reference in new issue
Block a user