We never ended up passing the right index but always zero.
Fix by rewriting build_item_tree to be basically the same as build_array_helper,
with two differences:
(1) we maintain absolute and relative children offsets and parent indices
(2) When traversing over the children of an element there are two scenarios: either
the element is a sub-component, in which case we iterate through the children of the root element,
or we can use ElementRc's children directly
We need to maintain the order of declaration and the sub-trees
of children need to be emitted before continuing with the parent.
This fixes the tab widget in the galler.y
There's a check that verifies that the relative item indices match, between what
the item tree building code in the generator sees and the generate_item_indices pass.
The counting of the relative indices was incorrect with regards to the sub-trees.
By accident the tree was still depth-first instead of level-order. This implementation works better,
by placing the root element of sub-components as
parents and the children into the children space later.
There's still more work to do to clean it up and make work with more complex scenarios.
(1) ... when the root element is a sub-component itself (the initialy child offset is not 1)
(2) when children themselves are sub-components, then they may occupy more entries in the item tree
Don't put them in a fake expression.
This simplifies a bit the expression handling, and will make
possible to fix analysis that needs a vew into the aliases
this implies that we need to make sure the property are initialized in
order so that constant properties that depends on other constant properties
are correctly computed
We need to embed resources in wasm builds. Unfortunately we can't detect
that we're called by say wasm-pack and "TARGET"/"HOST" only works inside
build.rs. So instead, to keep things simple, this change always embeds
the image resources when targeting Rust.
The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to
override this anywhere for any language.
Fixes#130
The objective is to have a bunch of .60 files with annotations inside
and the test harness picks them up and runs them through the Rust and
C++ frontend.
The LoweredItem and LoweredComponent contained, in essence, the same
information as the Element and Component in object_tree. Since the
moving declarations pass moved everything to the root element and the
LoweredPropertyDeclarations have been removed as well, this is the last
step.