Skip to content

Commit

Permalink
Make sure that the with and height of the inserted Window are not mak…
Browse files Browse the repository at this point in the history
…ed as constant

We need to do the ensure_window pass before the binding_analysis
otherwise the with and height property of the root element
will be considered as constant and will not adapt to the window size.

Unfortunately we can't really test that now because our test system
doesn't really test the Window, but here is a testcase:

```
  MainWindow := Rectangle {
     preferred-width: 400px;
     preferred-height: 400px;
     background: yellow;
     VerticalLayout {
          Rectangle {
              background: red;
              Text { text: root.width / 1px; }
          }
     }
  }
```

(we should see the red rectangle)
  • Loading branch information
ogoffart committed Jun 11, 2021
1 parent 7b63bb7 commit fb214a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sixtyfps_compiler/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ pub async fn run_passes(
diag,
)
.await;
passes::ensure_window::ensure_window(&doc.root_component, &doc.local_registry);
passes::collect_globals::collect_globals(&doc.root_component, diag);
passes::binding_analysis::binding_analysis(&doc.root_component, diag);
passes::deduplicate_property_read::deduplicate_property_read(&doc.root_component);
passes::move_declarations::move_declarations(&doc.root_component, diag);
passes::remove_aliases::remove_aliases(&doc.root_component, diag);
passes::resolve_native_classes::resolve_native_classes(&doc.root_component);
passes::ensure_window::ensure_window(&doc.root_component, &doc.local_registry);
passes::collect_structs::collect_structs(&doc.root_component, diag);
passes::generate_item_indices::generate_item_indices(&doc.root_component);
passes::collect_custom_fonts::collect_custom_fonts(
Expand Down

0 comments on commit fb214a8

Please sign in to comment.