GitXplorerGitXplorer
f

yoga

public
17231 stars
1419 forks
94 issues

Commits

List of commits on branch main.
Unverified
a112a07e6a5a8e1f59eaceca412210be2df832c3

Make it so that aspect ratio behaves like auto if it is 0 or inf (#1696)

jjoevilches committed 7 days ago
Unverified
dc4ab5ad571c91c2a29e35a66182315c01726f3c

update compileSdk to 35 (#1692)

aalanleedev committed 21 days ago
Unverified
6d6f69bee74f92e38d2a002d6ba20e25ef7c3dd7

Fix handling 'auto' checks in absolute layout (#1689)

ccoado committed 23 days ago
Unverified
596f8dff3c6b10bf0a3581e482a87b60e322796b

Extra log for case where availableHeight is undefined and sizing mode != max content (#1687)

jjoevilches committed a month ago
Unverified
ae8ede9b53cfc0ab123119ac66b4069c987e7566

Fix crash when you layout multiple absolute nodes in the same static subtree (#1686)

jjoevilches committed a month ago
Unverified
5009f5c1accb3dde14e1e18930df70c18c70dc75

Fix `misc-misplaced-const` warnings in Yoga tests (#1677)

NNickGerleman committed 3 months ago

README

The README file for this repository.

Yoga Support Ukraine CocoaPods npm Maven Central

Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.

Building

Yoga's main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.

./unit_tests <Debug|Release>

While not required, this script will use ninja if it is installed for faster builds.

Yoga is additionally part of the vcpkg collection of ports maintained by Microsoft and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Adding Tests

Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to gentest/fixtures.

<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
  <div style="width: 50px; height: 50px;"></div>
</div>

To generate new tests from added fixtures:

  1. Ensure you have yarn classic installed.
  2. Run yarn install to install dependencies for the test generator.
  3. Run yarn gentest in the yoga directory.

Debugging

Yoga provides a VSCode "launch.json" configuration which allows debugging unit tests. Simply add your breakpoints, and run "Debug C++ Unit tests (lldb)" (or "Debug C++ Unit tests (vsdbg)" on Windows).