summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-25 11:27:58 +0200
committerRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-25 16:30:52 +0200
commit4c08e3dfd5b3d985ae81bae22fee537fbf5d30db (patch)
treef4e3507620f2bb968372579379d702612efea323 /src/plugins/platforms/ios
parent956e88f23eaeae6251abe1e4029442cf052228fe (diff)
QIOSInputContext: animate screen from current transformation
Since we assign a fromValue to the scroll animation directly, the UIViewAnimationOptionBeginFromCurrentState flag does not have any effect. So we need to set the fromValue based on the current presentation state explicit. The reason why we need to ensure that we scroll from the current state is to avoid screen 'jumping' as a result of the scroll function being called many times during the same event loop cycle during after a focus change (focus object/window change, cursor rect change etc). Change-Id: Id98f43d60ec5d028b113361dab953569accf9b3f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 79fe33ce82..13e91889a2 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -394,7 +394,8 @@ void QIOSInputContext::scroll(int y)
animation = [CABasicAnimation animationWithKeyPath:@"sublayerTransform"];
}
- animation.fromValue = [NSValue valueWithCATransform3D:rootView.layer.sublayerTransform];
+ CATransform3D currentSublayerTransform = static_cast<CALayer *>([rootView.layer presentationLayer]).sublayerTransform;
+ animation.fromValue = [NSValue valueWithCATransform3D:currentSublayerTransform];
animation.toValue = [NSValue valueWithCATransform3D:translationTransform];
[rootView.layer addAnimation:animation forKey:@"AnimateSubLayerTransform"];
rootView.layer.sublayerTransform = translationTransform;