From d89e2047fee13d97b213ade4d32e356e3bde4924 Mon Sep 17 00:00:00 2001 From: Alisa Mylnikova Date: Wed, 3 Jun 2020 14:17:17 +0700 Subject: [PATCH] Fix #692: Consider layout transform in findNode --- .../types/animation_generators/Cache/AnimationCache.swift | 3 +++ Source/views/MacawView.swift | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/animation/types/animation_generators/Cache/AnimationCache.swift b/Source/animation/types/animation_generators/Cache/AnimationCache.swift index b049f19d..0dbcb49b 100644 --- a/Source/animation/types/animation_generators/Cache/AnimationCache.swift +++ b/Source/animation/types/animation_generators/Cache/AnimationCache.swift @@ -150,6 +150,9 @@ class AnimationUtils { } parent = parent?.parentRenderer } + if let viewPlace = renderer.view?.place { + uncachedParentsPlace = uncachedParentsPlace.concat(with: viewPlace) + } return uncachedParentsPlace } } diff --git a/Source/views/MacawView.swift b/Source/views/MacawView.swift index c46838e9..be4becd0 100644 --- a/Source/views/MacawView.swift +++ b/Source/views/MacawView.swift @@ -346,10 +346,11 @@ internal class DrawingView: MView { defer { MGraphicsEndImageContext() } - guard let ctx = MGraphicsGetCurrentContext() else { + guard let ctx = MGraphicsGetCurrentContext(), let inverted = self.place.invert() else { return .none } - return doFindNode(location: location, ctx: ctx) + let loc = location.applying(inverted.toCG()) + return doFindNode(location: loc, ctx: ctx) } // MARK: - Touches