GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - my-mc-mods/taffy-java: trying to port taffy to java

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
ci/consumer
ci/consumer
 
 
docs
docs
 
 
gentest
gentest
 
 
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Taffy-Java

A pure Java implementation of the Taffy UI layout library, supporting CSS Flexbox, Grid, and Block layout algorithms. It passes the Taffy test suite, ported to Java.

Install

implementation("dev.aika:taffy:1.2.0")
<dependency>
  <groupId>dev.aika</groupId>
  <artifactId>taffy</artifactId>
  <version>1.2.0</version>
</dependency>

Use the all classifier (dev.aika:taffy:1.2.0:all) if you do not want the fastutil runtime dependency.

Quick start

TaffyTree tree = new TaffyTree();

TaffyStyle item = TaffyStyle.builder().size(100f, 50f).build();
NodeId a = tree.newLeaf(item);
NodeId b = tree.newLeaf(item);

TaffyStyle rootStyle = TaffyStyle.builder()
    .display(TaffyDisplay.FLEX)
    .gap(0f, 10f)
    .build();
NodeId root = tree.newWithChildren(rootStyle, a, b);

tree.computeLayout(root, new TaffySize<>(
    AvailableSpace.definite(800f),
    AvailableSpace.definite(600f)
));

Layout lb = tree.getLayout(b); // b.x == 110

Full API guide: 中文 · English

Performance

Benchmarks live in src/jmh and run with ./gradlew jmh. The Java port is close to Rust on typical trees and slower under extreme depth/width; reproduce with the JMH sources in this repository before relying on any specific number.

Credits

  • Original Taffy library by DioxusLabs
  • Python bindings Stretchable for reference

This Java port was facilitated by AI.

About

trying to port taffy to java

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.