use super::WriteElement;

/// [feOffset](https://www.w3.org/TR/SVG11/filters.html#feOffsetElement)
#[derive(Debug)]
pub struct Offset {
    dx: f32,
    dy: f32,
}

impl Offset {
    pub fn new(dx: f32, dy: f32) -> Self {
        Self { dx, dy }
    }
}

impl WriteElement for Offset {
    fn attrs(&self) -> Vec<quick_xml::events::attributes::Attribute> {
        gen_attrs![b"dx": self.dx, b"dy": self.dy]
    }

    fn tag_name(&self) -> &'static str {
        "feOffset"
    }
}
