diff --git a/api/sixtyfps-cpp/include/sixtyfps.h b/api/sixtyfps-cpp/include/sixtyfps.h index 74abc62e7..04363aac3 100644 --- a/api/sixtyfps-cpp/include/sixtyfps.h +++ b/api/sixtyfps-cpp/include/sixtyfps.h @@ -587,15 +587,6 @@ public: return { &C::static_vtable, const_cast(&(**x.ptr)) }; } - void compute_layout(cbindgen_private::Rect parent_rect) const - { - if (!inner) - return; - for (auto &x : inner->data) { - (*x.ptr)->apply_layout({ &C::static_vtable, const_cast(&(**x.ptr)) }, parent_rect); - } - } - float compute_layout_listview(const Property *viewport_width, float listview_width) const { float offset = 0; diff --git a/api/sixtyfps-rs/lib.rs b/api/sixtyfps-rs/lib.rs index 901b5ebd1..8308f9931 100644 --- a/api/sixtyfps-rs/lib.rs +++ b/api/sixtyfps-rs/lib.rs @@ -372,18 +372,6 @@ pub mod testing { ) } - /// Applies the specified rectangular constraints to the component's layout. - pub fn apply_layout< - X: vtable::HasStaticVTable, - Component: Into> + ComponentHandle, - >( - component: &Component, - rect: sixtyfps_corelib::graphics::Rect, - ) { - let rc = component.clone_strong().into(); - vtable::VRc::borrow_pin(&rc).as_ref().apply_layout(rect); - } - /// Applies the specified scale factor to the window that's associated with the given component. /// This overrides the value provided by the windowing system. pub fn set_window_scale_factor< diff --git a/sixtyfps_runtime/corelib/component.rs b/sixtyfps_runtime/corelib/component.rs index a45b488ad..76b56ca21 100644 --- a/sixtyfps_runtime/corelib/component.rs +++ b/sixtyfps_runtime/corelib/component.rs @@ -11,7 +11,6 @@ LICENSE END */ //! This module contains the basic datastructures that are exposed to the C API -use crate::graphics::Rect; use crate::item_tree::{ItemVisitorVTable, TraversalOrder, VisitChildrenResult}; use crate::items::{ItemVTable, ItemWeak}; use crate::layout::LayoutInfo; @@ -47,9 +46,6 @@ pub struct ComponentVTable { /// Returns the layout info for this component pub layout_info: extern "C" fn(core::pin::Pin>) -> LayoutInfo, - /// Apply the layout to all the items in the component, and set the geometry of the root to the given rect - pub apply_layout: extern "C" fn(core::pin::Pin>, Rect), - /// in-place destructor (for VRc) pub drop_in_place: unsafe fn(VRefMut) -> vtable::Layout, /// dealloc function (for VRc) diff --git a/sixtyfps_runtime/corelib/model.rs b/sixtyfps_runtime/corelib/model.rs index ea2a3692a..2a2efe8ee 100644 --- a/sixtyfps_runtime/corelib/model.rs +++ b/sixtyfps_runtime/corelib/model.rs @@ -503,7 +503,6 @@ impl Repeater { }; for c in self.inner.borrow().borrow().components.iter() { c.1.as_ref().map(|x| { - x.as_pin_ref().apply_layout(Default::default()); get_height_visitor(x.as_pin_ref().get_item_ref(0)); }); } @@ -522,7 +521,6 @@ impl Repeater { self.ensure_updated_impl(&init, &model, 1); if let Some(c) = self.inner.borrow().borrow().components.get(0) { c.1.as_ref().map(|x| { - x.as_pin_ref().apply_layout(Default::default()); get_height_visitor(x.as_pin_ref().get_item_ref(0)); }); } else { @@ -632,13 +630,6 @@ impl Repeater { self.inner.borrow().borrow().components.iter().flat_map(|x| x.1.clone()).collect() } - /// Recompute the layout of each child elements - pub fn compute_layout(&self) { - for c in self.inner.borrow().borrow().components.iter() { - c.1.as_ref().map(|x| x.as_pin_ref().apply_layout(Default::default())); - } - } - /// Same as compule_layout, but only for the ListView pub fn compute_layout_listview( &self, diff --git a/sixtyfps_runtime/corelib/tests.rs b/sixtyfps_runtime/corelib/tests.rs index c09765ffb..931479d39 100644 --- a/sixtyfps_runtime/corelib/tests.rs +++ b/sixtyfps_runtime/corelib/tests.rs @@ -37,8 +37,6 @@ pub extern "C" fn sixtyfps_send_mouse_click( window: &ComponentWindow, ) { let mut state = crate::input::MouseInputState::default(); - vtable::VRc::borrow_pin(component).as_ref().apply_layout(Default::default()); - let pos = euclid::point2(x, y); state = crate::input::process_mouse_input( diff --git a/sixtyfps_runtime/interpreter/dynamic_component.rs b/sixtyfps_runtime/interpreter/dynamic_component.rs index e1e1e79da..40fff01fd 100644 --- a/sixtyfps_runtime/interpreter/dynamic_component.rs +++ b/sixtyfps_runtime/interpreter/dynamic_component.rs @@ -19,7 +19,7 @@ use sixtyfps_compilerlib::*; use sixtyfps_compilerlib::{diagnostics::BuildDiagnostics, object_tree::PropertyDeclaration}; use sixtyfps_compilerlib::{expression_tree::Expression, langtype::PropertyLookupResult}; use sixtyfps_corelib::component::{Component, ComponentRef, ComponentRefPin, ComponentVTable}; -use sixtyfps_corelib::graphics::{ImageReference, Rect}; +use sixtyfps_corelib::graphics::ImageReference; use sixtyfps_corelib::item_tree::{ ItemTreeNode, ItemVisitorRefMut, ItemVisitorVTable, TraversalOrder, VisitChildrenResult, }; @@ -139,7 +139,6 @@ impl RepeatedComponent for ErasedComponentBox { generativity::make_guard!(guard); let s = self.unerase(guard); - self.borrow().as_ref().apply_layout(Default::default()); s.component_type .set_property(s.borrow(), "y", Value::Number(*offset_y as f64)) .expect("cannot set y"); @@ -180,9 +179,6 @@ impl Component for ErasedComponentBox { fn layout_info(self: Pin<&Self>) -> sixtyfps_corelib::layout::LayoutInfo { self.borrow().as_ref().layout_info() } - fn apply_layout(self: Pin<&Self>, r: sixtyfps_corelib::graphics::Rect) { - self.borrow().as_ref().apply_layout(r) - } fn get_item_ref<'a>(self: Pin<&'a Self>, index: usize) -> Pin> { // We're having difficulties transferring the lifetime to a pinned reference // to the other ComponentVTable with the same life time. So skip the vtable @@ -789,7 +785,6 @@ fn generate_component<'id>( let t = ComponentVTable { visit_children_item, layout_info, - apply_layout, get_item_ref, parent_item, drop_in_place, @@ -1225,19 +1220,6 @@ extern "C" fn layout_info(component: ComponentRefPin) -> LayoutInfo { } } -extern "C" fn apply_layout(component: ComponentRefPin, _r: sixtyfps_corelib::graphics::Rect) { - generativity::make_guard!(guard); - // This is fine since we can only be called with a component that with our vtable which is a ComponentDescription - let instance_ref = unsafe { InstanceRef::from_pin_ref(component, guard) }; - - for rep_in_comp in &instance_ref.component_type.repeater { - generativity::make_guard!(g); - let rep_in_comp = rep_in_comp.unerase(g); - ensure_repeater_updated(instance_ref, rep_in_comp); - rep_in_comp.offset.apply_pin(instance_ref.instance).compute_layout(); - } -} - unsafe extern "C" fn get_item_ref(component: ComponentRefPin, index: usize) -> Pin { generativity::make_guard!(guard); let instance_ref = InstanceRef::from_pin_ref(component, guard); diff --git a/sixtyfps_runtime/rendering_backends/gl/graphics_window.rs b/sixtyfps_runtime/rendering_backends/gl/graphics_window.rs index b6c4bf300..5bda9a466 100644 --- a/sixtyfps_runtime/rendering_backends/gl/graphics_window.rs +++ b/sixtyfps_runtime/rendering_backends/gl/graphics_window.rs @@ -233,12 +233,11 @@ impl GraphicsWindow { runtime_window.meta_properties_tracker.as_ref().evaluate_if_dirty(|| { self.apply_geometry_constraint(component.as_ref().layout_info()); - component.as_ref().apply_layout(Default::default()); - if let Some((popup, pos)) = &*self.active_popup.borrow() { + if let Some((popup, _)) = &*self.active_popup.borrow() { let popup = ComponentRc::borrow_pin(popup); let popup_root = popup.as_ref().get_item_ref(0); - let size = if let Some(window_item) = ItemRef::downcast_pin(popup_root) { + if let Some(window_item) = ItemRef::downcast_pin(popup_root) { let layout_info = popup.as_ref().layout_info(); let width = @@ -256,11 +255,7 @@ impl GraphicsWindow { h = layout_info.min_height; height.set(h); } - Size::new(h, w) * self.scale_factor() - } else { - Size::default() }; - popup.as_ref().apply_layout(Rect::new(pos.clone(), size)); } }); diff --git a/sixtyfps_runtime/rendering_backends/qt/qt_window.rs b/sixtyfps_runtime/rendering_backends/qt/qt_window.rs index c85a5d446..e64066f82 100644 --- a/sixtyfps_runtime/rendering_backends/qt/qt_window.rs +++ b/sixtyfps_runtime/rendering_backends/qt/qt_window.rs @@ -845,7 +845,6 @@ impl QtWindow { if runtime_window.meta_properties_tracker.as_ref().is_dirty() { runtime_window.meta_properties_tracker.as_ref().evaluate(|| { self.apply_geometry_constraint(component.as_ref().layout_info()); - component.as_ref().apply_layout(Default::default()); }); } @@ -953,7 +952,6 @@ impl PlatformWindow for QtWindow { fn show(self: Rc) { let component_rc = self.self_weak.upgrade().unwrap().component(); let component = ComponentRc::borrow_pin(&component_rc); - component.as_ref().apply_layout(Default::default()); let root_item = component.as_ref().get_item_ref(0); if let Some(window_item) = ItemRef::downcast_pin(root_item) { self.apply_window_properties(window_item); diff --git a/tests/cases/children/children_placeholder.60 b/tests/cases/children/children_placeholder.60 index 99eb851f5..316136f39 100644 --- a/tests/cases/children/children_placeholder.60 +++ b/tests/cases/children/children_placeholder.60 @@ -36,14 +36,12 @@ TestCase := Container { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 200}); assert(instance.get_rect1_pos_ok()); ``` ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 200.))); assert!(instance.get_rect1_pos_ok()); ``` */ diff --git a/tests/cases/children/children_placeholder_two_levels.60 b/tests/cases/children/children_placeholder_two_levels.60 index 63247f402..0c9b6a3b7 100644 --- a/tests/cases/children/children_placeholder_two_levels.60 +++ b/tests/cases/children/children_placeholder_two_levels.60 @@ -44,14 +44,12 @@ TestCase := MegaContainer { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 200}); assert(instance.get_rect1_pos_ok()); ``` ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 200.))); assert!(instance.get_rect1_pos_ok()); ``` */ diff --git a/tests/cases/image_geometry.60 b/tests/cases/image_geometry.60 index 3d3db618c..885bd7db0 100644 --- a/tests/cases/image_geometry.60 +++ b/tests/cases/image_geometry.60 @@ -54,7 +54,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_fixed_image_default_image_fit_ok()); assert(instance.get_fixed_image_image_fit_override_ok()); assert(instance.get_image_in_layout_fit_ok()); @@ -66,7 +65,6 @@ assert(instance.get_image_with_missing_width_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_fixed_image_default_image_fit_ok()); assert!(instance.get_fixed_image_image_fit_override_ok()); assert!(instance.get_image_in_layout_fit_ok()); @@ -77,7 +75,6 @@ assert!(instance.get_image_with_missing_width_ok()); ```js var instance = new sixtyfps.TestCase(); -instance.send_mouse_click(5., 5.); assert(instance.fixed_image_default_image_fit_ok); assert(instance.fixed_image_image_fit_override_ok); assert(instance.image_in_layout_fit_ok); diff --git a/tests/cases/layout/box_alignment.60 b/tests/cases/layout/box_alignment.60 index 8aeba83a1..d19328d8e 100644 --- a/tests/cases/layout/box_alignment.60 +++ b/tests/cases/layout/box_alignment.60 @@ -77,7 +77,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_v1()); assert(instance.get_v2()); assert(instance.get_v3()); @@ -90,7 +89,6 @@ assert(instance.get_c1()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_v1()); assert!(instance.get_v2()); assert!(instance.get_v3()); diff --git a/tests/cases/layout/box_preferred_size.60 b/tests/cases/layout/box_preferred_size.60 index e040fca8f..78d9b7422 100644 --- a/tests/cases/layout/box_preferred_size.60 +++ b/tests/cases/layout/box_preferred_size.60 @@ -37,7 +37,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_fake_image_width_ok()); assert(instance.get_fake_image_height_ok()); ``` @@ -45,7 +44,6 @@ assert(instance.get_fake_image_height_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_fake_image_width_ok()); assert!(instance.get_fake_image_height_ok()); ``` diff --git a/tests/cases/layout/default_fill.60 b/tests/cases/layout/default_fill.60 index 0f4380d36..75e6704eb 100644 --- a/tests/cases/layout/default_fill.60 +++ b/tests/cases/layout/default_fill.60 @@ -28,7 +28,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_elem1_ok()); assert(instance.get_elem2_ok()); assert(instance.get_elem3_ok()); @@ -37,7 +36,6 @@ assert(instance.get_elem3_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_elem1_ok()); assert!(instance.get_elem2_ok()); assert!(instance.get_elem3_ok()); diff --git a/tests/cases/layout/grid.60 b/tests/cases/layout/grid.60 index f4947fdb4..6d07c15d4 100644 --- a/tests/cases/layout/grid.60 +++ b/tests/cases/layout/grid.60 @@ -42,7 +42,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); assert(instance.get_rect3_pos_ok()); @@ -52,7 +51,6 @@ assert_eq(instance.get_layout_width(), 300); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); assert!(instance.get_rect3_pos_ok()); diff --git a/tests/cases/layout/grid2.60 b/tests/cases/layout/grid2.60 index 26eff2de1..22daadbdd 100644 --- a/tests/cases/layout/grid2.60 +++ b/tests/cases/layout/grid2.60 @@ -65,7 +65,6 @@ TestCase := Window { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_size_ok()); assert(instance.get_x_ok()); assert(instance.get_y_ok()); @@ -74,7 +73,6 @@ assert(instance.get_y_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_size_ok()); assert!(instance.get_x_ok()); assert!(instance.get_y_ok()); diff --git a/tests/cases/layout/grid_min_max.60 b/tests/cases/layout/grid_min_max.60 index 1609aba5d..c9880d1f3 100644 --- a/tests/cases/layout/grid_min_max.60 +++ b/tests/cases/layout/grid_min_max.60 @@ -54,7 +54,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); assert(instance.get_rect3_pos_ok()); @@ -63,7 +62,6 @@ assert(instance.get_rect3_pos_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); assert!(instance.get_rect3_pos_ok()); diff --git a/tests/cases/layout/grid_padding.60 b/tests/cases/layout/grid_padding.60 index 01863bc07..1e0b77092 100644 --- a/tests/cases/layout/grid_padding.60 +++ b/tests/cases/layout/grid_padding.60 @@ -58,7 +58,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 600, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); ``` @@ -66,7 +65,6 @@ assert(instance.get_rect2_pos_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); ``` diff --git a/tests/cases/layout/grid_preferred_size.60 b/tests/cases/layout/grid_preferred_size.60 index 75fc9afb4..58fbf9de0 100644 --- a/tests/cases/layout/grid_preferred_size.60 +++ b/tests/cases/layout/grid_preferred_size.60 @@ -42,7 +42,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_fake_image_width_ok()); assert(instance.get_fake_image_height_ok()); ``` @@ -50,7 +49,6 @@ assert(instance.get_fake_image_height_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_fake_image_width_ok()); assert!(instance.get_fake_image_height_ok()); ``` diff --git a/tests/cases/layout/grid_within_for.60 b/tests/cases/layout/grid_within_for.60 index fba9575e0..2863d2830 100644 --- a/tests/cases/layout/grid_within_for.60 +++ b/tests/cases/layout/grid_within_for.60 @@ -41,7 +41,6 @@ TestCase := Rectangle { auto handle = TestCase::create(); const TestCase &instance = *handle; sixtyfps::testing::send_mouse_click(&instance, -1., -1.); // FIXME: Force creation of repeater components before computing the layout -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); sixtyfps::testing::send_mouse_click(&instance, 190., 190.); assert_eq(instance.get_value(), 1+1); @@ -55,7 +54,6 @@ assert_eq(instance.get_value(), 1+1+2); let instance = TestCase::new(); sixtyfps::testing::send_mouse_click(&instance, -1., -1.); // FIXME: Force creation of repeater components before computing the layout -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); sixtyfps::testing::send_mouse_click(&instance, 190., 190.); assert_eq!(instance.get_value(), 1+1); diff --git a/tests/cases/layout/horizontal_sizes.60 b/tests/cases/layout/horizontal_sizes.60 index bd81f3d3a..06c129037 100644 --- a/tests/cases/layout/horizontal_sizes.60 +++ b/tests/cases/layout/horizontal_sizes.60 @@ -69,7 +69,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_blue_rect_ok()); assert(instance.get_red_rect_ok()); assert(instance.get_green_rect_ok()); @@ -81,7 +80,6 @@ assert(instance.get_pink_rect_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_blue_rect_ok()); assert!(instance.get_red_rect_ok()); assert!(instance.get_green_rect_ok()); diff --git a/tests/cases/layout/issue_140.60 b/tests/cases/layout/issue_140.60 index 240970a59..ee2a2f750 100644 --- a/tests/cases/layout/issue_140.60 +++ b/tests/cases/layout/issue_140.60 @@ -24,13 +24,13 @@ HelloWorld := Window { ```cpp auto handle = HelloWorld::create(); const HelloWorld &instance = *handle; -HelloWorld::apply_layout({&HelloWorld::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); +sixtyfps::testing::send_mouse_click(&instance, 5., 5.); ``` ```rust let instance = HelloWorld::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); +sixtyfps::testing::send_mouse_click(&instance, 5., 5.); ``` */ diff --git a/tests/cases/layout/nested_boxes.60 b/tests/cases/layout/nested_boxes.60 index 1f907ddc4..ea0503909 100644 --- a/tests/cases/layout/nested_boxes.60 +++ b/tests/cases/layout/nested_boxes.60 @@ -132,7 +132,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect_blue_ok()); assert(instance.get_rect_orange_ok()); assert(instance.get_rect_red_ok()); @@ -145,7 +144,6 @@ assert(instance.get_rect_black2_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect_blue_ok()); assert!(instance.get_rect_orange_ok()); assert!(instance.get_rect_red_ok()); diff --git a/tests/cases/layout/nested_grid.60 b/tests/cases/layout/nested_grid.60 index afbd8b392..8da47d6e5 100644 --- a/tests/cases/layout/nested_grid.60 +++ b/tests/cases/layout/nested_grid.60 @@ -45,7 +45,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); assert(instance.get_rect3_pos_ok()); @@ -57,7 +56,6 @@ assert(instance.get_rect6_pos_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); assert!(instance.get_rect3_pos_ok()); diff --git a/tests/cases/layout/nested_grid_2.60 b/tests/cases/layout/nested_grid_2.60 index 5325c47b4..948828f28 100644 --- a/tests/cases/layout/nested_grid_2.60 +++ b/tests/cases/layout/nested_grid_2.60 @@ -55,7 +55,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); assert(instance.get_rect3_pos_ok()); @@ -65,7 +64,6 @@ assert(instance.get_rect4_pos_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); assert!(instance.get_rect3_pos_ok()); diff --git a/tests/cases/layout/nested_grid_minmax.60 b/tests/cases/layout/nested_grid_minmax.60 index 505e42f9a..9a0fa0923 100644 --- a/tests/cases/layout/nested_grid_minmax.60 +++ b/tests/cases/layout/nested_grid_minmax.60 @@ -44,7 +44,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_rect1_pos_ok()); assert(instance.get_rect2_pos_ok()); ``` @@ -52,7 +51,6 @@ assert(instance.get_rect2_pos_ok()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_rect1_pos_ok()); assert!(instance.get_rect2_pos_ok()); ``` diff --git a/tests/cases/layout/path.60 b/tests/cases/layout/path.60 index 00b3ff6d3..fc40131c5 100644 --- a/tests/cases/layout/path.60 +++ b/tests/cases/layout/path.60 @@ -85,7 +85,6 @@ TestCase := Rectangle { ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; -TestCase::apply_layout({&TestCase::static_vtable, const_cast(&instance) }, sixtyfps::Rect{0, 0, 300, 300}); assert(instance.get_test1()); assert(instance.get_test2()); assert(instance.get_test3()); @@ -96,7 +95,6 @@ assert(instance.get_test5()); ```rust let instance = TestCase::new(); -sixtyfps::testing::apply_layout(&instance, sixtyfps::re_exports::Rect::new(Default::default(), sixtyfps::re_exports::Size::new(300., 300.))); assert!(instance.get_test1()); assert!(instance.get_test2()); assert!(instance.get_test3());