diff --git a/api/sixtyfps-node/lib/index.ts b/api/sixtyfps-node/lib/index.ts index 48612569a..18f77df8c 100644 --- a/api/sixtyfps-node/lib/index.ts +++ b/api/sixtyfps-node/lib/index.ts @@ -26,16 +26,6 @@ function load_native_lib() { */ let native = !process.env.SIXTYFPS_NODE_NATIVE_LIB ? require('../native/index.node') : load_native_lib(); -/** - * @hidden - */ -interface Rect { - x: number, - y: number, - width: number, - height: number -} - /** * @hidden */ @@ -65,10 +55,6 @@ class Component { send_keyboard_string_sequence(s: String) { this.comp.send_keyboard_string_sequence(s) } - - apply_layout(rect: Rect) { - this.comp.apply_layout(rect) - } } /** diff --git a/api/sixtyfps-node/native/lib.rs b/api/sixtyfps-node/native/lib.rs index ab1427492..b09863804 100644 --- a/api/sixtyfps-node/native/lib.rs +++ b/api/sixtyfps-node/native/lib.rs @@ -11,7 +11,7 @@ use core::cell::RefCell; use neon::prelude::*; use rand::RngCore; use sixtyfps_compilerlib::langtype::Type; -use sixtyfps_corelib::{graphics::Rect, ImageReference, SharedVector}; +use sixtyfps_corelib::{ImageReference, SharedVector}; mod js_model; mod persistent_context; @@ -478,22 +478,6 @@ declare_types! { })?; Ok(JsUndefined::new().as_value(&mut cx)) } - - method apply_layout(mut cx) { - let rect = cx.argument::(0)?; - let x = rect.get(&mut cx, "x")?.downcast::().unwrap().value(); - let y = rect.get(&mut cx, "y")?.downcast::().unwrap().value(); - let width = rect.get(&mut cx, "width")?.downcast::().unwrap().value(); - let height = rect.get(&mut cx, "height")?.downcast::().unwrap().value(); - let this = cx.this(); - let component = cx.borrow(&this, |x| x.0.as_ref().map(|c| c.clone_strong())); - let component = component.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?; - run_scoped(&mut cx,this.downcast().unwrap(), || { - sixtyfps_interpreter::testing::apply_layout(&component, Rect::new((x as f32, y as f32).into(), (width as f32, height as f32).into())); - Ok(()) - })?; - Ok(JsUndefined::new().as_value(&mut cx)) - } } } diff --git a/sixtyfps_runtime/interpreter/api.rs b/sixtyfps_runtime/interpreter/api.rs index b769c56c4..99caae5d9 100644 --- a/sixtyfps_runtime/interpreter/api.rs +++ b/sixtyfps_runtime/interpreter/api.rs @@ -868,10 +868,6 @@ pub mod testing { &comp.inner.window(), ); } - /// Applies the specified rectangular constraints to the component's layout. - pub fn apply_layout(comp: &super::ComponentInstance, rect: sixtyfps_corelib::graphics::Rect) { - comp.inner.borrow().as_ref().apply_layout(rect); - } } #[test] diff --git a/tests/cases/layout/box_cross_axis_pref_size.60 b/tests/cases/layout/box_cross_axis_pref_size.60 index 03e02721c..90ba60472 100644 --- a/tests/cases/layout/box_cross_axis_pref_size.60 +++ b/tests/cases/layout/box_cross_axis_pref_size.60 @@ -44,7 +44,7 @@ assert!(instance.get_fake_image_ok()); ```js var instance = new sixtyfps.TestCase(); -instance.apply_layout({x: 0, y: 0, width: 300, height: 300}); +instance.send_mouse_click(5., 5.); assert(instance.fake_image_ok); ```