2019-06-06 19:36:56 -07:00
|
|
|
/*
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-01-08 11:42:43 -08:00
|
|
|
*
|
2018-11-29 11:35:34 -08:00
|
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
|
|
* file in the root directory of this source tree.
|
2017-01-08 11:42:43 -08:00
|
|
|
*/
|
|
|
|
#import "YGLayout.h"
|
Fix bugs introduced with YogaKit improvements
Summary:
I'm trying to fix some bugs I introduced in my latest PR, but while writing the Unit Tests for them, I saw a really weird behaviour. The following exact piece of code WORKS inside a Yoga C++ unit test, but fails from a Objective-C unit test. I had me completely confused and blocked me in my progression. Any ideas?
```
TEST(YogaTest, stupid_test) {
const YGNodeRef node = YGNodeNew();
YGNodeStyleSetPosition(node, YGEdgeLeft, 1);
ASSERT_FLOAT_EQ(1, YGNodeStyleGetPosition(node, YGEdgeLeft).value);
ASSERT_EQ(YGUnitPixel, YGNodeStyleGetPosition(node, YGEdgeLeft).unit);
YGNodeFree(node);
}
```
```
- (void)testPositionalPropertiesWork
{
YGNodeRef node = YGNodeNew();
YGNodeStyleSetPosition(node, YGEdgeLeft, 1);
XCTAssertEqual(1, YGNodeStyleGetPosition(node, YGEdgeLeft).value);
XCTAssertEqual(YGUnitPixel, YGNodeStyleGetPosition(node, YGEdgeLeft).unit);
YGNodeFree(node);
}
```
Closes https://github.com/facebook/yoga/pull/328
Reviewed By: dshahidehpour
Differential Revision: D4421504
Pulled By: emilsjolander
fbshipit-source-id: f59379edf70aee87a77cd1ad2986313cdfe71b94
2017-01-18 09:14:33 -08:00
|
|
|
#import <yoga/Yoga.h>
|
2017-01-08 11:42:43 -08:00
|
|
|
|
Fix bugs introduced with YogaKit improvements
Summary:
I'm trying to fix some bugs I introduced in my latest PR, but while writing the Unit Tests for them, I saw a really weird behaviour. The following exact piece of code WORKS inside a Yoga C++ unit test, but fails from a Objective-C unit test. I had me completely confused and blocked me in my progression. Any ideas?
```
TEST(YogaTest, stupid_test) {
const YGNodeRef node = YGNodeNew();
YGNodeStyleSetPosition(node, YGEdgeLeft, 1);
ASSERT_FLOAT_EQ(1, YGNodeStyleGetPosition(node, YGEdgeLeft).value);
ASSERT_EQ(YGUnitPixel, YGNodeStyleGetPosition(node, YGEdgeLeft).unit);
YGNodeFree(node);
}
```
```
- (void)testPositionalPropertiesWork
{
YGNodeRef node = YGNodeNew();
YGNodeStyleSetPosition(node, YGEdgeLeft, 1);
XCTAssertEqual(1, YGNodeStyleGetPosition(node, YGEdgeLeft).value);
XCTAssertEqual(YGUnitPixel, YGNodeStyleGetPosition(node, YGEdgeLeft).unit);
YGNodeFree(node);
}
```
Closes https://github.com/facebook/yoga/pull/328
Reviewed By: dshahidehpour
Differential Revision: D4421504
Pulled By: emilsjolander
fbshipit-source-id: f59379edf70aee87a77cd1ad2986313cdfe71b94
2017-01-18 09:14:33 -08:00
|
|
|
@interface YGLayout ()
|
|
|
|
|
|
|
|
@property (nonatomic, assign, readonly) YGNodeRef node;
|
2017-01-08 11:42:43 -08:00
|
|
|
|
|
|
|
- (instancetype)initWithView:(UIView *)view;
|
|
|
|
|
|
|
|
@end
|