Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

NSEdgeInsets/UIEdgeInsets boxing #17

Closed
indragiek opened this issue Aug 5, 2013 · 5 comments · Fixed by #18
Closed

NSEdgeInsets/UIEdgeInsets boxing #17

indragiek opened this issue Aug 5, 2013 · 5 comments · Fixed by #18

Comments

@indragiek
Copy link
Contributor

MEDBox can handle boxing these in NSValue already, but there's no geometry type for it. I would need to implement the NS equivalent of UIEdgeInsetsInsetRect as well, so I was wondering if I should put that in a separate header? And also, should the implementation of NSEdgeInsetsInsetRect respect the flipped state of the view?

EDIT: Sorry, the flipped state thing is confusing. I was mixing up the thoughts I had for integrating this into RCL operators with the geometry type itself.

@jspahrsummers
Copy link
Contributor

I've kinda punted on this, because I really hate that NSEdgeInsets and UIEdgeInsets have different names and associated functions.

Maybe we could have a MEDEdgeInsets macro/typedef that just expands to the platform-specific types, and then duplicate the UIKit functions as MEDEdgeInsetsInsetRect, etc. for both platforms to use interchangeably.

@indragiek
Copy link
Contributor Author

NSEdgeInsets definitely feels like an afterthought that doesn't have any functions to support it, but I think having some way of using insets like this would be useful. The MEDEdgeInsets idea sounds fine to me, should we go with that?

@jspahrsummers
Copy link
Contributor

@indragiek
Copy link
Contributor Author

Where should the typedef/functions be implemented? The CGGeometry extensions or somewhere else?

@jspahrsummers
Copy link
Contributor

Their own header would be ideal, and then a custom geometry type added to the NSValue extensions.

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

Successfully merging a pull request may close this issue.

2 participants