Skip to content
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

Fix depth-ordering update #3486

Merged
merged 5 commits into from
May 30, 2022
Merged

Fix depth-ordering update #3486

merged 5 commits into from
May 30, 2022

Conversation

farmaazon
Copy link
Contributor

Pull Request Description

There are two dirty flags in layers: depth_order_dirty and element_depth_order_dirty - one marking changed in Layer, second marking change in one of sublayers. The depth_order_dirty has a proper callback for setting element_depth_order_dirty of its parent. However, the latter did not propagate up.
I fixed it by adding callback for element_depth_order_dirty which sets the depth_order_dirty of the parent.

Important Notes

  • The question to @wdanilo : is it possible, that I can propagate dirty directly to element_depth_order_dirty, without setting depth_order_dirty? As far as I understand the code, it would also work (and we would omit some unnecessary updates).
  • I tried to leave some logs, but I don't feel how to do that: the tooling I used was very specific, only the concrete ids of symbols and layers were logged, and I don't know how to generalize it.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • [ ] Unit tests have been written where possible. - The code is a bit untestable due to high coupling.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run.sh ide dist and ./run.sh ide watch.

@farmaazon farmaazon self-assigned this May 26, 2022
@farmaazon farmaazon requested a review from wdanilo as a code owner May 26, 2022 08:19
@@ -851,11 +851,22 @@ impl LayerDynamicShapeInstance {
// === Sublayers ===
// =================

/// Unboxed callback.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd write here doc about what the callback does, not what this line is syntactically.

Comment on lines 860 to 862
move || {
parent_depth_order_dirty.set();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

braces not needed

move || {
for sublayers in parents.borrow().iter() {
// It's safe to do it having parents borrowed, because the only possible callback called
// OnElementDepthOrderDirty, which don't borrow_mut at any point.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the [`...`] syntax when referring to Rust entities.

@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label May 30, 2022
@mergify mergify bot merged commit d07246d into develop May 30, 2022
@mergify mergify bot deleted the wip/farmaazon/fix-renderer-bug branch May 30, 2022 10:32
jdunkerley pushed a commit that referenced this pull request May 31, 2022
There are two dirty flags in layers: depth_order_dirty and element_depth_order_dirty - one marking changed in Layer, second marking change in one of sublayers. The depth_order_dirty has a proper callback for setting element_depth_order_dirty of its parent. However, the latter did not propagate up.
I fixed it by adding callback for element_depth_order_dirty which sets the depth_order_dirty of the parent.

# Important Notes
* The question to @wdanilo : is it possible, that I can propagate dirty directly to element_depth_order_dirty, without setting depth_order_dirty? As far as I understand the code, it would also work (and we would omit some unnecessary updates).
* I tried to leave some logs, but I don't feel how to do that: the tooling I used was very specific, only the concrete ids of symbols and layers were logged, and I don't know how to generalize it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants