During the rendering, if an area is clipped, it will not be rendered and
therefore will not be rendered as a dependency.
Consider this example:
```
HorizontalBox {
Rectangle {
TouchArea{
Rectangle { background: parent.pressed ? red : blue; }
}
}
Rectangle {
clip: true;
TouchArea{
Rectangle { background: parent.pressed ? red: blue; }
}
}
}
}
```
Clicking on the first rectangle will make that area dirty and it will be
redrawn, but since the second one is clipped away, the renderer will not
visit the child items. And clicking on the second rectangle will not
make it re-drawn.
This patch makes sure we rejuster ad dependency of the window tracker
the non-dirty areas
This fix the printerdemo_mcu stopping to render in some cases
```
warning: unused return value of `alloc::boxed::Box::<T>::from_raw` that must be used
Warning: --> internal/core/properties.rs:382:9
|
382 | Box::from_raw(_self as *mut BindingHolder<B>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
```
Just do what the note says
... via two ways bindings
Otherwise we could be in a case where we have an unbounded number of "shared" property
which might not be shared anymore if the original property goes out of scope
When resetting the binding, we need to mark dependent property as dirty.
It just hapenned that the current implementation always set all bindings
before starting to query the properties, so this problem was not seen
before. But there is an exception when setting the two_way bindings,
then we may set the binding after the property was querried because
setting a two way binding actually queries the property
The README.md contains the warning that used to be in lib.rs.
Add README.md files to all internal crates
... pointing to the official public crate to use instead.
Rename internal crates
fixup: README files
fixup rename
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.
pre-commit applied some cleanups to the moved files:
- Consistent newline at end of file policy
- trimming trailing whitespace
- Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_runtime/corelib/properties.rs (Browse further)