Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

RCL doesn't respect flipped coordinate space? #93

Closed
zakdances opened this issue Oct 1, 2013 · 2 comments
Closed

RCL doesn't respect flipped coordinate space? #93

zakdances opened this issue Oct 1, 2013 · 2 comments
Labels

Comments

@zakdances
Copy link
Contributor

I have a window that has a contentView with a flipped coordinate space in OSX. I do something like this:

RCLFrame(subHeader) = @{rcl_rect: subHeader.rcl_frameSignal,
                      rcl_top: [RACSignal return:@(100)]};

and the y coordinate of "subHeader" ends up as -100. Is this intended behavior? Is it recommended to avoid flipping the coordinate space of parent views?

edit Looks like something else is going on. I tried a value of -50 for rcl_top and the y gets set at -250. Why?

@zakdances
Copy link
Contributor Author

In RACSignal+RCLGeometryAdditions.m, NSLayoutBottom is mapped to CGRectMinYEdge. Seems like it should be mapped to CGRectMaxYEdge. Is this correct?

@jspahrsummers
Copy link
Member

You're correct that RCL does not honor flipped coordinate systems. It's not actually possible for it to do so without providing some kind of view reference to basically every rect operator, since flippedness as a concept only makes sense within a specific coordinate system.

NSLayoutBottom is mapped to CGRectMinYEdge. Seems like it should be mapped to CGRectMaxYEdge. Is this correct?

No, the current values are correct for an unflipped coordinate system, which is what RCL targets. In AppKit, (0, 0) is the lower-left of the screen by default.

If you're flipping views just to make geometry calculation easier, I would strongly recommend against that, because they cause all sorts of mayhem and confusion even outside of RCL.

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

No branches or pull requests

2 participants