skia_safe/modules/svg/
stop.rs

1use super::NodeSubtype;
2use crate::{
3    impl_default_make,
4    prelude::*,
5    svg::{DebugAttributes, Length},
6};
7use skia_bindings as sb;
8
9pub type Stop = RCHandle<sb::SkSVGStop>;
10
11impl NodeSubtype for sb::SkSVGStop {
12    type Base = sb::SkSVGContainer;
13}
14
15impl_default_make!(Stop, sb::C_SkSVGStop_Make);
16
17impl DebugAttributes for Stop {
18    const NAME: &'static str = "Stop";
19
20    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
21        self.as_base()._dbg(builder.field("offset", &self.offset()));
22    }
23}
24
25impl Stop {
26    skia_svg_macros::attrs! {
27        SkSVGStop => {
28            offset: Length [get(value) => Length::from_native_ref(value), set(value) => value.into_native()]
29        }
30    }
31}