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

@ -5,8 +5,8 @@ use itertools::Itertools;
use lyon::tessellation::geometry_builder::{BuffersBuilder, VertexBuffers};
use lyon::tessellation::{FillAttributes, FillOptions, FillTessellator};
use sixtyfps_corelib::abi::datastructures::{
Color, ComponentWindow, ComponentWindowOpaque, PathElement, Point, Rect, RenderingPrimitive,
Resource, Size,
Color, ComponentWindow, ComponentWindowOpaque, PathElement, PathLineTo, Point, Rect,
RenderingPrimitive, Resource, Size,
};
use sixtyfps_corelib::graphics::{
FillStyle, Frame as GraphicsFrame, GraphicsBackend, GraphicsWindow, HasRenderingPrimitive,
@ -342,7 +342,7 @@ impl RenderingPrimitivesBuilder for GLRenderingPrimitivesBuilder {
let mut path_builder = lyon::path::Path::builder().with_svg();
for element in elements.iter() {
match element {
PathElement::LineTo { x, y } => {
PathElement::LineTo(PathLineTo { x, y }) => {
path_builder.line_to(Point::new(*x, *y))
}
}