Prepare the path element setup in the run-time for extensibility

Make the anonymous struct for the LineTo variant in the PathElement enum
as separate structure, which can be introspected using rtto::FieldInfo.
This commit is contained in:
Simon Hausmann 2020-07-07 10:47:13 +02:00
parent 9d9779ecde
commit 1ab71b8ca3
8 changed files with 39 additions and 22 deletions

View file

@ -1,7 +1,7 @@
use core::cell::RefCell;
use neon::prelude::*;
use sixtyfps_compilerlib::typeregister::Type;
use sixtyfps_corelib::abi::datastructures::{PathElement, Resource};
use sixtyfps_corelib::abi::datastructures::{PathElement, PathLineTo, Resource};
use sixtyfps_corelib::{ComponentRefPin, EvaluationContext};
use std::rc::Rc;
@ -161,7 +161,7 @@ fn to_js_value<'cx>(
let element_object = JsObject::new(cx);
match element {
PathElement::LineTo { x, y } => {
PathElement::LineTo(PathLineTo { x, y }) => {
let x = JsNumber::new(cx, *x);
let x = x.as_value(cx);
element_object.set(cx, "x", x)?;