Skip to content

Store taffy node keys in components #8297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7e24dff
changes:
ickshonpe Apr 3, 2023
460c438
Remove `TaffyNode` and `TaffyParent` components when `Node` is removed.
ickshonpe Apr 3, 2023
7060b94
changes:
ickshonpe Apr 3, 2023
0fd7b89
changes:
ickshonpe Apr 3, 2023
584d6c7
changes:
ickshonpe Apr 13, 2023
2efb1f3
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe Apr 13, 2023
6739af2
cargo fmt
ickshonpe Apr 13, 2023
feb61f7
handle window events for ui in a separate system
ickshonpe Apr 13, 2023
b4a6a7a
fix scale factor changed check
ickshonpe Apr 13, 2023
f7dbefb
cargo fmt
ickshonpe Apr 13, 2023
d2a7eac
move window update back into `flex_node_system`
ickshonpe Apr 13, 2023
183677a
* Renamed `FlexSuface` to `UiSurface`.
ickshonpe Apr 13, 2023
c93106f
fixed tests
ickshonpe Apr 13, 2023
accd08e
Cargo fmt --all
ickshonpe Apr 13, 2023
51c69be
doc comment and clippy fixes
ickshonpe Apr 13, 2023
a189982
changes:
ickshonpe Apr 14, 2023
bf07f5d
added another test
ickshonpe Apr 14, 2023
9a3c942
replaced `scale_factor_changed` and `resized` fields with a single `r…
ickshonpe Apr 14, 2023
ea55781
Renamed `insert_new_ui_nodes_into_layout` to `insert_new_uinodes` and
ickshonpe Apr 15, 2023
1a05f2a
cargo fmt
ickshonpe Apr 15, 2023
0b2f6b0
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe Apr 20, 2023
9589cf7
fix errors from merge
ickshonpe Apr 20, 2023
b8419d5
Fixed remaining errors from merge
ickshonpe Apr 21, 2023
bd83803
fix imports
ickshonpe Apr 21, 2023
8d7a365
use a parallel iterator to update UI transforms
ickshonpe Apr 22, 2023
6620e3e
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe May 3, 2023
e08a4aa
fixed errors from merge
ickshonpe May 3, 2023
975d97c
cargo fmt
ickshonpe May 3, 2023
e623288
fix doc comments
ickshonpe May 3, 2023
1fb196d
fixed needless borrows
ickshonpe May 3, 2023
7572eb6
more doc comment fixes
ickshonpe May 3, 2023
e62e63a
Renamed `remove_entities` to `remove_nodes`
ickshonpe May 3, 2023
5b81399
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe May 9, 2023
5444d9c
* Fixed bugs in `debug` and `accessibility` caused by merge.
ickshonpe May 9, 2023
ae01206
cargo fmt --all
ickshonpe May 9, 2023
92ec6e5
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe May 11, 2023
8b34f59
changes:
ickshonpe May 22, 2023
4313bf0
changes:
ickshonpe May 22, 2023
0c9e9c1
changes:
ickshonpe May 22, 2023
523b536
changes:
ickshonpe May 22, 2023
fc38722
check for `Node` not `NodeSize` removed components
ickshonpe May 22, 2023
1430d68
fixed removal detection
ickshonpe May 22, 2023
4f05ae6
remove rather than reuse old taffy nodes
ickshonpe May 23, 2023
2b2908e
also do a full update on window creation
ickshonpe May 23, 2023
f021661
`window_changed` check refactor
ickshonpe May 23, 2023
011bc4a
changed name of taffy key component to `UiKey`
ickshonpe May 26, 2023
c4eda4f
Removed the insertion system
ickshonpe May 29, 2023
40abcf4
Cleaned up some comments, removed the `Clone` impl for `UiKey`.
ickshonpe May 29, 2023
601ccd9
Doc comments edit.
ickshonpe May 29, 2023
dac334d
Merge branch 'main' into taffy-key-component
ickshonpe May 29, 2023
67c92b9
removed unnecessary changes
ickshonpe May 29, 2023
487d78f
removed `is_null` method, cargo fmt --all
ickshonpe May 29, 2023
ff8e117
Renamed `UiKey` to `UiNodeId`, added type alias `NodeId` for `taffy::…
ickshonpe May 30, 2023
aa4f932
added `UiSurface` methods for insertion, and setting style and measur…
ickshonpe May 30, 2023
183bc3f
Merge branch 'main' into taffy-key-component
ickshonpe Jun 14, 2023
7d5c8ad
cargo fmt --all
ickshonpe Jun 14, 2023
79ddbcd
Changed `UiNodeId` from a tuple struct to a stuct with a `taffy_id` f…
ickshonpe Jun 14, 2023
5156726
Merge branch 'store-taffy-keys-in-components' into taffy-key-componen…
ickshonpe Jun 14, 2023
97be1c4
Renamed `UiNodeId` to `UiKey`, and moved its struct declaration to th…
ickshonpe Jun 14, 2023
afc397a
cargo fmt --all
ickshonpe Jun 14, 2023
997fc32
Changed some paramter names to be more descriptive.
ickshonpe Jun 14, 2023
68c150f
Removed `LayoutError` as it's no longer used.
ickshonpe Jun 14, 2023
73f2596
`layout` module:
ickshonpe Jun 16, 2023
9546431
`Taffykey`:
ickshonpe Jun 16, 2023
e8388a5
`Taffykey`:
ickshonpe Jun 16, 2023
e654987
Merge branch 'store-taffy-keys-in-components' of https://github.com/i…
ickshonpe Jun 16, 2023
5fc76a1
cargo fmt
ickshonpe Jun 16, 2023
7deab35
moved window handling in `ui_layout_system` outside of the update logic.
ickshonpe Jun 16, 2023
f029505
Merge branch 'main' into store-taffy-keys-in-components
alice-i-cecile Jun 19, 2023
866aa9f
Merge branch 'main' into store-taffy-keys-in-components
ickshonpe Aug 21, 2023
b67c30c
Cleaned up left over comments from merge
ickshonpe Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/bevy_ui/src/layout/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl UiRect {
}
}

pub fn from_style(context: &LayoutContext, style: &Style) -> taffy::style::Style {
pub fn from_style(style: &Style, context: &LayoutContext) -> taffy::style::Style {
taffy::style::Style {
display: style.display.into(),
position: style.position_type.into(),
Expand Down Expand Up @@ -466,8 +466,8 @@ mod tests {
grid_column: GridPlacement::start(4),
grid_row: GridPlacement::span(3),
};
let viewport_values = LayoutContext::new(1.0, bevy_math::Vec2::new(800., 600.));
let taffy_style = from_style(&viewport_values, &bevy_style);
let context = LayoutContext::new(bevy_math::Vec2::new(800., 600.), 1.0);
let taffy_style = from_style(&bevy_style, &context);
assert_eq!(taffy_style.display, taffy::style::Display::Flex);
assert_eq!(taffy_style.position, taffy::style::Position::Absolute);
assert!(matches!(
Expand Down Expand Up @@ -633,7 +633,7 @@ mod tests {
#[test]
fn test_into_length_percentage() {
use taffy::style::LengthPercentage;
let context = LayoutContext::new(2.0, bevy_math::Vec2::new(800., 600.));
let context = LayoutContext::new(bevy_math::Vec2::new(800., 600.), 2.);
let cases = [
(Val::Auto, LengthPercentage::Points(0.)),
(Val::Percent(1.), LengthPercentage::Percent(0.01)),
Expand Down
Loading