28 Commits

Author SHA1 Message Date
Huy Nguyen
6736367627 [ASStackLayoutSpec] Refactor baseline alignment algorithm (#2892)
* Add tests for baseline alignments

* Merge baseline alignment algorithm to the main stack algorithm
- Baseline alignment is now part of the main stack algorithm.
- ASStackBaselinePositionedLayout is no longer needed and removed.

* All snapshot test cases of ASStackLayoutSpec are passing now

* Remove baselineRelativeArrangement

* Remove TODO

* Minor fixes in cross size determination step
2017-01-18 11:12:10 -08:00
Adlai Holler
92bbfc112f Generate an iOS 9 reference image for testTextContainerInsetIsIncludedWithSmallerConstrainedSize (#2880) 2017-01-09 12:55:31 -08:00
Michael Schneider
bc0443db02 Don’t floor space between items for ASStackLayoutJustifyContentSpaceBetween and ASStackLayoutJustifyContentSpaceAround 2016-11-17 18:05:22 -08:00
Adlai Holler
5c15869087 Disable Text Node Fast Path (#2581)
* Disable text node fast path

* Actually commit the test change
2016-11-09 10:25:02 +09:00
Adlai Holler
3eb7a307fa Share a singleton shadower for all cases when shadow isn't drawn, fix issues (#2511) 2016-10-30 15:34:29 -07:00
Michael Schneider
021f5ebdbb Add initial snapshot tests for ASWrapperSpec (#2482) 2016-10-27 16:27:09 -07:00
Adlai Holler
0d439a43b6 [ASTextNode] Add Fast-Paths For Text Measurement and Drawing (#2392)
* Add test case for TextKit truncation style

* Add fast path for text node measurement with default truncation

* Use fast path more often

* Reverse options order

* Simplify implementation – no functional change

* Share "isScaled" variable

* Intersect with constrained rect

* Add a failing test case for fast-path truncation

* Add some more truncation tests, using slow path as reference image

* Update the tests

* In ASTextKitRenderer, intersect bounds with constrained rect

* Add test case for TextKit truncation style

* Add fast path for text node measurement with default truncation

* Use fast path more often

* Reverse options order

* Simplify implementation – no functional change

* Share "isScaled" variable

* Intersect with constrained rect

* Add a failing test case for fast-path truncation

* Add some more truncation tests, using slow path as reference image

* Update the tests

* In ASTextKitRenderer, intersect bounds with constrained rect

* Use maximumNumberOfLines property in text kit fast path

Add reference images

Disable fast-path for max-one-line case

* Remove unneeded snapshot files
2016-10-24 17:05:59 -07:00
Michael Schneider
6fcbf642c9 Remove all 3x snapshot test images (#2417) 2016-10-18 13:12:24 -07:00
Michael Schneider
ba80b83695 [ASRelativeLayoutSpec] Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart (#2393)
* Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart

* Add updated images for snapshot tests
2016-10-18 12:00:01 -07:00
Michael Schneider
94f958c4a3 [Layout] Treat flex factors as true factors (#2349)
* Treat flex factors as factors

* Add snapshot tests

* Address comments
2016-10-06 16:53:26 -04:00
Hannah Troisi
87595c7d3b [Layout API] Rename ASStaticLayoutSpec to ASAbsoluteLayoutSpec (#2288)
* Rename static to absolute

* Fix examples, rename ASAbsoluteLayoutSpec class method

* rename +staticLayoutSpecWithChildren to +absoluteLayoutSpecWithChildren

* address Michael's comments
2016-09-28 13:05:31 -04:00
Michael Schneider
e85583523f [Layout] Add support for flex factor (#2298)
* Add support for flex factor

* Add snapshot tests

* Respect child specified size from ASLayoutable

* Add new snapshot test images

* Fix rebase conflict
2016-09-27 18:39:50 -04:00
Adlai Holler
1e86dcdbe2 [ASDisplayNode] Use kCGBlendModeCopy in a Couple More Places (#2250)
* Use blend mode copy in a couple more places

* Add some tests
2016-09-15 11:56:46 -07:00
Michael Schneider
905508e9be Factor in constrained size for final size calculation of ASTextNode (#2146) 2016-08-26 11:55:13 -07:00
Michael Schneider
47d84aa7fe Add snapshot test for ASBackgroundLayoutSpec (#2131) 2016-08-25 21:18:52 -07:00
Garrett Moon
dfe4585cec Add ability to force the size which an image node is rendered. (#2107)
* Add ability to force the size which an image node is rendered.

* Add unit tests for forced scaling.

* Whoops, need results!

* Round forced scaling.

* Check size of contents too.

* Remove unnecessary container node.
2016-08-23 16:01:43 -07:00
Adlai Holler
99574a728c Make our snapshot testing possible without framework-private access, simplify (#2083) 2016-08-17 17:42:37 -07:00
Nikita Lutsenko
2091df9607 [ASTextNode] Fix highlighting when textContainerInsets are set. (#2073)
* [ASTextNode] Fix highlighting when textContainerInsets are set.

* Add ASTextNodeSnapshotTests to xcodeproj.

* Add snapshot test for container inset and highlighting.
2016-08-16 10:18:51 -07:00
Garrett Moon
2c9e51e8f7 Add support for textContainerInset to ASTextNode (ala UITextView) (#2062)
* Add support for textContainerInset to ASTextNode (ala UITextView)

* Better comment, parens to increase readability. Thanks @schneider!

* Add textContainerInset snapshot test.
2016-08-12 12:07:00 -07:00
Adlai Holler
7abceba4a0 Rename snapshot test reference images 2016-08-10 10:26:21 -07:00
Levi McCallum
ca2fb0bc74 Update FBSnapshotTestCase and generate @3x images 2016-06-08 13:33:03 -07:00
Sam Stow
086bd8a52b [ASRelativeLayoutSpec] New core layout spec type: Relative Position, now powers Center as well.
This spec allows positioning a child at any 9-part box position (corners, edges, or center).
2016-03-19 22:37:02 -07:00
appleguy
d132416d90 Merge pull request #848 from nguyenhuy/JustifyContentSpaceBetweenAndAround
Implement "space between" and "space around" justify content options for stack layout
2015-11-29 21:46:42 -08:00
Huy Nguyen
0077c3eec6 Implement horizontal and vertical alignments for stack layout 2015-11-24 20:57:19 +02:00
Huy Nguyen
1162e02b06 Implement "space between" and "space around" options of stack layout justify content 2015-11-16 19:34:08 +02:00
Huy Nguyen
938cd468b3 Add snapshot tests for ASStaticLayoutSpec. 2015-10-19 20:37:20 +03:00
Huy Nguyen
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00
Huy Nguyen
e23a3fe4c2 Add layout tests. 2015-06-25 11:34:36 +07:00