From 4c08e3dfd5b3d985ae81bae22fee537fbf5d30db Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 25 Sep 2014 11:27:58 +0200 Subject: QIOSInputContext: animate screen from current transformation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/ios/qiosinputcontext.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/ios') 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([rootView.layer presentationLayer]).sublayerTransform; + animation.fromValue = [NSValue valueWithCATransform3D:currentSublayerTransform]; animation.toValue = [NSValue valueWithCATransform3D:translationTransform]; [rootView.layer addAnimation:animation forKey:@"AnimateSubLayerTransform"]; rootView.layer.sublayerTransform = translationTransform; -- cgit v1.2.3