agens-no / AGGeometryKit

Quadrilaterals on CALayer, CGGeometry-functions, UIView/CALayer properties and other invaluable tools.
Other
1.27k stars 130 forks source link

Hello, when i set quadrilateral, the position of the layer is shifted, and how to remove the quadrilateral settings #46

Closed EasonGaoDevelop closed 7 years ago

EasonGaoDevelop commented 7 years ago

Hello, when i set quadrilateral, the position of the layer is shifted, how to remove the quadrilateral settings, I use a uiimageview to achieve the quadrilateral deformation function, uiimageview can be dragged within a certain range, but as long as using quadrilateral, Accurate, so i need to remove the quadrilateral settings after the deformation

hfossli commented 7 years ago

Hey! Thanks for using our library! Can you share some code? Kind of hard to grasp what you are saying :)

EasonGaoDevelop commented 7 years ago

hello, I refer to your demo like this code self.layer.quadrilateral = AGKQuadMake(self.topLeftControl.center, self.topRightControl.center, self.bottomRightControl.center, self.bottomLeftControl.center);

how to remove quadrilateral setting

EasonGaoDevelop commented 7 years ago

When i set up self.imageView.layer.quadrilateral after the finger drags the imageView out of the screen, I have touched in the touchesMoved method, but it is invalid, and I guess that anchorPoint has changed image

hfossli commented 7 years ago

Yep, anchor point must be set to 0,0 for the quad to render correctly. Is the blue square on top left your desired result after removing the quadrilateral?

EasonGaoDevelop commented 7 years ago
bdaa4d13-e92d-4993-a0b3-50bc33957e40

I need imageView to be dragged in red box exactly, i need to remove the blue box in the top left corner and what should i do

hfossli commented 7 years ago

Sorry, there's just too little context and code here for me to help you. Maybe you can zip a demo project showing your problem?

EasonGaoDevelop commented 7 years ago

Can you give me your email? I made a zip demo project to you!

hfossli commented 7 years ago

Awesome. It's in my bio here https://github.com/hfossli :)

hfossli commented 7 years ago

I don't think I have received any mail :)

EasonGaoDevelop commented 7 years ago

I'm sorry, I have other things to delay, I will give you a demo mail at tomorrow

EasonGaoDevelop commented 7 years ago

Hello, demo has been sent to your hfossli@gmail.com