Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible change to support drawing outside the viewToCurl? #38

Open
marcpalmer opened this issue Jan 13, 2013 · 12 comments
Open

Possible change to support drawing outside the viewToCurl? #38

marcpalmer opened this issue Jan 13, 2013 · 12 comments

Comments

@marcpalmer
Copy link
Contributor

Hi,

It seems that if you have a view that is not full screen size, that the curled corner (not the one being dragged) clips to the bounds of the viewToCurl. masksToBounds = NO does not help here, I presume because the EAGL layer is being created with the frame of the viewToCurl as dimensions.

Surely we should be able to support this so that the shadow and page corners render outside of the view bounds. How would we do this? Create the EAGLLayer with full screen dimensions (or a rect from a property) and masksToBounds = NO?

I can probably hack this for now by adding clear space to the top of my viewToCurl, so there is space for the top corner of my "paper" to render - but shadows will still not extend outside of the bounds. If you imagine a "paper" view with a background of wood behind and around it, you want the shadow to continue outside of the paper's rect.

@xissburg
Copy link
Owner

There's a similar issue still open here: #26

Since the contents of the view is drawn using OpenGL, it is limited to the frame buffer size, which is identical to the view size. One solution to this problem is to add a (or some) transform property(ies) that allows the coder to transform the page mesh so he will be able to move, scale, rotate, etc, it. This feature will also be useful when we get to implement two-page view like an open book, which will be great for landscape orientation.

@marcpalmer
Copy link
Contributor Author

I'm going to try something I think that will work better. A new view that allows framebuffer size of screen, and also acts as container for the view to curl so no need for the weird xbpagedragview to jump around the view hierarchy.

@supnate
Copy link

supnate commented Feb 26, 2013

Thank you very much for providing such a fantastic library. I just want to know is there any progress on this issue?

@xissburg
Copy link
Owner

@supnate This is the next feature I am going to implement. You will be able to control the location of the page inside the XBCurlView as if it was a subview of it. I will add properties like frame, center, bounds and transform. Then, you will be able to create a fullscreen XBCurlView for instance, and display a smaller page inside of it. Due to the transparency, everything behind it will be rendered properly.

@supnate
Copy link

supnate commented Feb 27, 2013

@xissburg Thank you very much for the reply! Glad to know you are working on this. Great job! Thank you!

@MobileVet
Copy link

First off, let me say this is a great library with a beautiful resulting transform. Thanks for being so thorough in your math!

I was also really excited to hear that you were working on this issue as we see it as the only missing element. Can you let me know if you are actively working on it or if it is a 'sometime in the future' thing?
Thanks!

@marcpalmer
Copy link
Contributor Author

On 12 Mar 2013, at 19:05, MobileVet [email protected] wrote:

First off, let me say this is a great library with a beautiful resulting transform. Thanks for being so thorough in your math!

I was also really excited to hear that you were working on this issue as we see it as the only missing element. Can you let me know if you are actively working on it or if it is a 'sometime in the future' thing?
Thanks!

I'm currently looking at doing this in my private fork of the code but it looks rather non-trivial because the mesh needs to be translated to the position within the view where you actually want the curling view, plus you need to translate all the interactive curl coordinates from the view coordinate space to the offset page, and reject any curl events occurring outside the area you actually want to curl.

At least, that's then only way I can see how to do it right now.

Or can turning clips to bounds off work with an open gl layer?

@xissburg
Copy link
Owner

@MobileVet I already have a (possibly solid) idea to solve this problem and I am still trying to find some spare time to work on it.

@marcpalmer clip to bounds does not work with OpenGL because drawing is limited to the area of the frame buffer which has the same size of the view. I am creating a XBPage class that will contain the data and methods for one single page. The cylinder properties will be part of this class. This will also allow you to have several pages inside the same XBCurlView. XBPage will also have properties such as frame, bounds, center, transform, autoresizingMask, etc so it will look like a subview of the XBCurlView (however it is not a subclass of UIView, of course).

@MobileVet
Copy link

@marcpalmer Definitely non-trivial... however, isn't the transform static? By that I mean, once you figure out the transform between the full view and the smaller subview that you want to curl, can't you apply that to all the various elements? Maybe I am over simplifying it.

For the event situation, you should be able to look for an intersection between the event and the view that you want to curl. Anything that doesn't intersect could be dropped.

@MobileVet
Copy link

Just curious if this was something you were actively pursuing? I know you had talked about looking for time to work on it in the past and wondered if you had made any progress. We might have a chance to look at it and don't want to duplicate work.
Cheers

@xissburg
Copy link
Owner

@MobileVet not yet, I will be busy with other projects for at least a month from now.

@MatteoK
Copy link

MatteoK commented Feb 5, 2014

Hey xissburg. First of all thanks for this awesome libarary. Did you ever get around to fixing this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants