Skip to content

Commit

Permalink
Convert hit point to viewForClearTouches coordinate system
Browse files Browse the repository at this point in the history
  • Loading branch information
Domas Nutautas committed Dec 11, 2019
1 parent 95bf863 commit b2fe69e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/ClearContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ open class ClearContainerView: UIView {

open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let superHit = super.hitTest(point, with: event)
guard backgroundColor == nil || backgroundColor == .clear else { return superHit }

return self == superHit ? viewForClearTouches?.hitTest(point, with: event) : superHit
guard
backgroundColor == nil || backgroundColor == .clear,
self == superHit
else { return superHit }

return viewForClearTouches?.hitTest(convert(point, to: viewForClearTouches), with: event)
}
}

0 comments on commit b2fe69e

Please sign in to comment.