Skip to content

Conversation

@paramaggarwal
Copy link
Contributor

In development, watch for changes to src/Layout.js and keep running tests whenever the file changes. Helps to ensure that a breaking change is not introduced while developing.

vjeux added a commit that referenced this pull request Aug 28, 2015
Watch for changes and run tests during development using `grunt watch`.
@vjeux vjeux merged commit e6d3aea into facebook:master Aug 28, 2015
@paramaggarwal
Copy link
Contributor Author

That was fast! Thanks @vjeux. (Please also bless facebook/react-native#1776! 😛)

@vjeux
Copy link
Contributor

vjeux commented Aug 28, 2015

Yeah so sorry about this, I want to do a proper review of aspectRatio and merge it but I kept putting it to the next day :(

@paramaggarwal
Copy link
Contributor Author

facebook/react-native#1776 is the tiny css-layout change that was needed to allow the children of a measure function based node to also be laid out.

Regarding the aspectRatio PR, I am looking at how to make aspectRatio work horizontally too. Currently because measure only works one way (given width, it calculates height) the aspectRatio also works in just one direction. To be able to use aspectRatio such that given a height, it would calculate the width to maintain ratio, we need to make measure more generic.

Any idea how to make measure take both width and height, so that it can work both ways?

@vjeux
Copy link
Contributor

vjeux commented Aug 28, 2015

Oh interesting. Yeah would be nice. You should look at sizeThatFits and layoutSubviews in iOS. It has proven to be a good abstraction to implement "hard" layouts. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instm/UIView/sizeThatFits:

@ColinEberhardt
Copy link
Contributor

Thanks for the contribution to the build :-)

Quick question - is there any reason the watch runs the ci task rather than the build task? (See the comments that describe the difference)

@paramaggarwal
Copy link
Contributor Author

@ColinEberhardt The build task would cause Chrome to keep opening again and again while developing. This is more like continuous integration if you think about it.

@paramaggarwal
Copy link
Contributor Author

@vjeux The sizeThatFits API looks nice. It takes a CGSize as input - pretty much what we need for our generic measure function in css-layout. Currently measure only takes width - hence the limitation.

Just need to modify css-layout to let measure take a width and a height and then set layout properties based on the returned value.

@ColinEberhardt
Copy link
Contributor

@paramaggarwal fair enough, I guess that would be quite disruptive.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants