Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Issue #5: Added valid frame template
Browse files Browse the repository at this point in the history
  • Loading branch information
ikorich committed Apr 27, 2017
1 parent 30efbd1 commit 7e790df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ extension IGRCropView {
frame.size.height = location.y
}

//TODO: Added test cropViewInsideValidFrame

if (frame.size.width > self.cornerBorderLength
&& frame.size.height > self.cornerBorderLength) {
self.frame = frame
Expand Down
5 changes: 5 additions & 0 deletions IGRPhotoTweaks/PhotoTweakView/CropView/IGRCropView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import UIKit
Calls ones, when user stop interaction with view
*/
@objc func cropViewDidStopCrop(_ cropView: IGRCropView)

/*
Calls ones, when change a Crop frame
*/
@objc func cropViewInsideValidFrame(for point: CGPoint, from cropView: IGRCropView) -> Bool
}

@objc(IGRCropView) public class IGRCropView: UIView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,10 @@ extension IGRPhotoTweakView : IGRCropViewDelegate {
self.highlightMask(false, animate: true)
self.manualMove = false
}

public func cropViewInsideValidFrame(for point: CGPoint, from cropView: IGRCropView) -> Bool {
let updatedPoint = self.convert(point, to: self.scrollView.photoContentView)
let frame = self.scrollView.photoContentView.frame
return frame.contains(updatedPoint)
}
}

0 comments on commit 7e790df

Please sign in to comment.