When there is an animaiton but no expression, the binding is
left with an invalid expression.
State was keeping that invalid expression as part of sub expression
this is a regression since commit ba32777cab
Sixtyfps uses euclid already, so let's use euclid for float comparisons
as well.
I changed the code to decide whether a number is a positive integer to
make do without a comparison along the way.
After commit 492af0f67c the native class
name of "Window" changed to "WindowItem", so the string based check here
didn't match anymore. For consistency this match now uses the element
name instead, like in other places in the compiler.
and replace it with the internal, re-exported WindowHandleAccess
one.
Strictly speaking, this is a breaking change. In practice the
returned type of this trait was in `sixtyfps::re_exports`, so any
public use is questionable :)
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
If we were to add `sixtyfps:🪟:Window` to the re_exports, then
this clashes. We might rename the former, but this is a cleaner naming
in any case.
Relates to #333
On Windows the default stack size is less than on Linux/macOS and
therefore an issues surfaces that is however operating system agnostic:
Due to inlining we generate quite big inner components with many fields.
Their field offsets are accumulated in the separate FIELD_OFFSETS
struct. The access pattern typically looks like this:
Self::FIELD_OFFSETS.some_field.apply_pin(...)
This is destructed into at least two smaller operations, fetching
some_field and then calling apply_pin with that field as self parameter.
In Rust debug builds the first operation, unfortunately, ends up making
a full copy of Self::FIELD_OFFSETS into a temporary variable on the
stack. Unfortunately also that stack space isn't reused, so every access
results in a new stack allocation to hold all of the FIELD_OFFSETS
structure (~5kb in the printer demo).
With so many accesses to that in the generated code, we run out of stack
space already in the new() function, in item_tree() as well as in the
Drop impl that also accesses all field offsets.
This patch applies the following workaround that does the trick. The
above expression is replaced with
{
let field = &Self::FIELD_OFFSETS.some_field;
*field
}.apply_pin(...)
Fixes#133