Clean up ahead of PR.

pull/1/head
Matthew Chen 6 years ago
parent 794241963e
commit b8775006bb

@ -127,16 +127,18 @@ class ImageEditorGestureRecognizer: UIGestureRecognizer {
return isNewTouch ? .invalid : .outside
}
// Ignore touches that start near the top or bottom edge of the screen;
// they may be a system edge swipe gesture.
let rootView = self.rootView(of: view)
let rootLocation = firstTouch.location(in: rootView)
let distanceToTopEdge = max(0, rootLocation.y)
let distanceToBottomEdge = max(0, rootView.bounds.size.height - rootLocation.y)
let distanceToNearestEdge = min(distanceToTopEdge, distanceToBottomEdge)
let kSystemEdgeSwipeTolerance: CGFloat = 50
if (distanceToNearestEdge < kSystemEdgeSwipeTolerance) {
return .invalid
if isNewTouch {
// Ignore touches that start near the top or bottom edge of the screen;
// they may be a system edge swipe gesture.
let rootView = self.rootView(of: view)
let rootLocation = firstTouch.location(in: rootView)
let distanceToTopEdge = max(0, rootLocation.y)
let distanceToBottomEdge = max(0, rootView.bounds.size.height - rootLocation.y)
let distanceToNearestEdge = min(distanceToTopEdge, distanceToBottomEdge)
let kSystemEdgeSwipeTolerance: CGFloat = 50
if (distanceToNearestEdge < kSystemEdgeSwipeTolerance) {
return .invalid
}
}
return .valid

@ -293,9 +293,6 @@ public class ImageEditorView: UIView, ImageEditorModelDelegate {
// at "point=pixel" scale.
layer.contentsScale = 1.0
// TODO:
Logger.verbose("layer.contentsScale: \(layer.contentsScale)")
layer.render(in: context)
}

Loading…
Cancel
Save