skia_safe/modules/svg/shape/
path.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::{
    impl_default_make,
    prelude::*,
    svg::{DebugAttributes, NodeSubtype},
};
use skia_bindings as sb;

pub type Path = RCHandle<sb::SkSVGPath>;

impl NodeSubtype for sb::SkSVGPath {
    type Base = sb::SkSVGShape;
}

impl_default_make!(Path, sb::C_SkSVGPath_Make);

impl DebugAttributes for Path {
    const NAME: &'static str = "Path";

    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
        self.as_base()._dbg(builder.field("path", &self.path()));
    }
}

impl Path {
    skia_svg_macros::attrs! {
        SkSVGPath => {
            path: crate::Path [get(value) => crate::Path::from_native_ref(value), set(value) => value.into_native()]
        }
    }
}