Summary: Previously pointScaleFactor was stored as a divider that opened way to accumulating difference. For instance in ScreenScale=3, pointScaleFactor = 0.3333343 (0.000001 error). When used for width = 300 that error was multiplied by the number of times pointScale contained in width (300 *3 = 900) and we had almost 0.001 error accumulated. With this change Yoga will avoid such issue
Reviewed By: shergin
Differential Revision: D5137923
fbshipit-source-id: 652b59bc3da3f35ee93ffa3695936f623298a023
Summary:
Travis doesn't set encrypted variables in pull requests (for very good reasons),
but openssl fails rather loudly if it doesn't get them. Our artifact publishing
script happily skips PRs anyway, so we don't need these variables in that case.
Reviewed By: emilsjolander
Differential Revision:
D5137092
Tags: accept2ship
fbshipit-source-id: b14d61feba0bb98a1705b2f8232f52ba59a2c734
Summary: Implement the inverse of toString. This allows us to parse a YogaValue from a string inputted from the user in debugging tools.
Reviewed By: kittens
Differential Revision: D5120456
fbshipit-source-id: 6ac7cff2a040778e63a953070e1bd7e768fedaa7
Summary: To fix builds where `sdks =` is not supported.
Reviewed By: splhack
Differential Revision: D5113020
fbshipit-source-id: b716acd6fb88ccb55c72b24f9fcdf20a2ea3693e
Summary: There is a case when measure() function will be called with negative width/height because of margin/padding. This diff fixes that scenario
Reviewed By: emilsjolander
Differential Revision: D5111534
fbshipit-source-id: 99f09b85f0c6a0e5dec89a26baba8f9d560100da
Summary: This makes the output less messy.
Reviewed By: emilsjolander
Differential Revision: D5111279
fbshipit-source-id: c65c7f275e57312fb56c2edfec429cc3d2373e3f
Summary:
Make sure that the gradle tests pass before publishing the snapshot. Also makes
sure that we don't break the gradle build.
Reviewed By: emilsjolander
Differential Revision: D5020044
fbshipit-source-id: dfebd829701717eac3ed078a807cd10f489f4348
Summary:
calculateLayoutWithSize: can be useful when calculating table/collection view sizes before the views are fully laid out by UIKit.
Closes https://github.com/facebook/yoga/pull/558
Differential Revision: D5104863
Pulled By: emilsjolander
fbshipit-source-id: e0e0c6d502f6745be8d84de8c1b6e24cc25a0352
Summary:
This adds the same logic that we have in place with Litho for Yoga, allowing
unit tests to run with Gradle for Yoga. It'll still shell out to Buck to build
the native library, but that's hopefully only until we have found a way to reuse
the NDK build. For CI this shouldn't matter as we want to run `buck build`
anyway and the build step should be a no-op.
FB-Only:
This should unlock D5020044.
Reviewed By: emilsjolander
Differential Revision: D5104154
fbshipit-source-id: 48732fff6c1d100a155452f675de343aaf06427b
Summary:
1, Change bottom to be based� on height of parent.
2, Respect margin value when layout with right/bottom.
Closes https://github.com/facebook/yoga/pull/552
Differential Revision: D5102090
Pulled By: emilsjolander
fbshipit-source-id: dca291413ffc2027d7628f4c8b8eeeb0b4823bc2
Summary:
This is used in a stack where I'm using YogaKit on tvOS. fb_apple_library needs `sdks = ` to get buck to do its thing for tvOS.
This seems like it should be OK since apple_library is a nop on non apple platforms (which makes sense since this is ObjC only) - I think that makes sense anyway?
Reviewed By: emilsjolander
Differential Revision: D5080261
fbshipit-source-id: f08d7e6d2599b9af25fb964ade485aef552f306b
Summary: We should always try to make root node as small as possible, while previously this wasn't functioning this way
Reviewed By: emilsjolander
Differential Revision: D5071164
fbshipit-source-id: b8afef42477d0ed87d0c9fcfd26349e0a0babd6e
Summary: When config was added to YGNodeCanUseCachedMeasurement we didn't account for default 0 scale factor. This diff fixes that
Reviewed By: emilsjolander
Differential Revision: D5061016
fbshipit-source-id: 907ef987bd0ead29cf02f6945a3f03d4ffb58a2e
Summary: We want to be able to use YGConfig to account for possible rounding of width/height
Reviewed By: emilsjolander
Differential Revision: D5059560
fbshipit-source-id: d729e991758a8c668a4b373105b71337961875cd
Summary: Include margin when calculating if children overflow
Reviewed By: passy
Differential Revision: D5044471
fbshipit-source-id: e7c1eb694445ffb898bcf375d9deefc558c49f11
Summary: Fix flex basis not being constraint to the max size in the main direction. Previously this caused the added test to fail due to NaN in child dimensions.
Reviewed By: gkassabli
Differential Revision: D5044314
fbshipit-source-id: d9f9db832e4943a57a89c9d162ff6077b709795a
Summary: This adds very little (no?) new features and mostly just refactors code to live in a singular place. Instead of users having to worry about DebugComponent as well as the DebugInfo object and attaching it correctly to a tree now user's of the DebugComponent API only need to worry about a single class, greatly simplifying its usage.
Reviewed By: passy
Differential Revision: D5027780
fbshipit-source-id: 95a95b3572747aa2088f8f9b35a160257eb59269
Summary: This diff adds node type definition to Yoga and moves rounding to rely on the node type. If the node has measure function we consider that node to be text node, otherwise we have default behavior.
Reviewed By: emilsjolander
Differential Revision: D5025107
fbshipit-source-id: a8d66e2f9c5d02ab080784cc474be583a09b92e2
Summary: Also bumped the version number for the existing dependency examples.
Reviewed By: emilsjolander
Differential Revision: D5044190
fbshipit-source-id: 4199ab114450a256efaa30a811822923beafb378
Summary:
Fix some long-standing issues with the android build on Travis (and elsewhere)
and enable automatic publishing of snapshots.
Reviewed By: emilsjolander
Differential Revision: D5044001
fbshipit-source-id: f00be07f33c8018573af0b98233068ebd93360b4
Summary: The appcompat library was way outdated and failed CI: https://travis-ci.org/facebook/yoga/builds/231065300
Reviewed By: emilsjolander
Differential Revision: D5043967
fbshipit-source-id: a5bb02110cf016972d983f511cf8c31dd9d667e1
Summary: So I can use them from JSBigString whose methods are marked const.
Reviewed By: emilsjolander
Differential Revision: D5020648
fbshipit-source-id: 6e60b80cb3d4718bab25dd6ca9627aee862117db
Summary:
Gets all the pieces in place to automatically publish snapshot artifacts after
successful travis build.
I'll test the actual publishing in a separate branch and then flip the switch in
a separate diff when it's ready.
Reviewed By: emilsjolander
Differential Revision: D5028239
fbshipit-source-id: c57d02a1dee41c84001bd17821b050c8c9aa4134
Summary:
Reuse the gradle setup we've built for Litho which allows for parallel publishing to Bintray and Maven Central in addition to Sonatype Snapshots.
This appears not to break the existing jcenter deploy script which is pretty great.
Reviewed By: emilsjolander
Differential Revision: D5020576
fbshipit-source-id: 3ef163ccbfe91c6858b051d39dcf237ca388e18d
Summary:
fbjni was previously dependency-free but now requires some annotations and
soloader. This unbreaks the gradle build.
Reviewed By: emilsjolander
Differential Revision: D5020069
fbshipit-source-id: b8bde83ce6a70b06e04491f1d70c2a6b568bc99c
Summary:
Moves the `YGLogger` into `YGConfig` and pass the `YGNodeRef` into the logger to be able to associate the log messages and assertions with the specific node.
Tackles facebook/yoga#530 and facebook/yoga#446
Closes https://github.com/facebook/yoga/pull/531
Reviewed By: astreet
Differential Revision: D4970149
Pulled By: emilsjolander
fbshipit-source-id: b7fcdaa273143ea2fa35861620b2e4d79f04f0af
Summary:
ActionBarActivity has been deprecated for 2+ years now.
Closes https://github.com/facebook/yoga/pull/538
Differential Revision: D4985973
Pulled By: emilsjolander
fbshipit-source-id: 09f2a8a12943c9b3ccdaee9cac684276b42ff843
Summary:
ActionBarActivity has been deprecated for 2+ years now.
Closes https://github.com/facebook/yoga/pull/539
Differential Revision: D4985970
Pulled By: emilsjolander
fbshipit-source-id: 2e2fcc5188c08ef1cd78f7e1be71917f0395ff2c
Summary: See blame revision. we are still passing all the added tests from that pull request but with much simpler logic.
Reviewed By: gkassabli
Differential Revision: D4977923
fbshipit-source-id: cb488e63c7c2e15e4c0f0133a16df36580c646fd
Summary: We need to treat measurements from nodes with measure functions as minimum values as to not truncate text.
Reviewed By: shergin
Differential Revision: D4972290
fbshipit-source-id: 0a7bcc7f47b3e5acb8745da5286abcb9c4e44a38
Summary:
We still need to wait for the `YGUnitPoint` PR to be merged :) But please let me know what you think. One caveat: because of a limitation of Swift, a literal value can be automatically understood as a point-based `YGValue`, but variables have to be explicitly cast. I haven't found a way around it yet:
```
view.yoga.width = 10 // value == 10, unit == YGUnitPixel
let a: CGFloat = 100
view.yoga.height = a // Compiler error
view.yoga.height = YGValue(a) // works, not great
```
Closes https://github.com/facebook/yoga/pull/390
Reviewed By: emilsjolander
Differential Revision: D4954021
Pulled By: maxoll
fbshipit-source-id: 5eff6aeb6dd969d0d5dc557b149bb5819b0e31de
Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking.
See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506
Reviewed By: astreet
Differential Revision: D4954016
Pulled By: emilsjolander
fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7