Commit 11b37c99 authored by Ivan Molodetskikh's avatar Ivan Molodetskikh

Add some missing attributes

parent fbf3fc05
......@@ -63,7 +63,7 @@ pub type RsvgFilterContext = FilterContext;
/// The filter rendering context.
pub struct FilterContext {
/// the <filter> node
/// The <filter> node.
node: RsvgNode,
/// The source graphic surface.
source_surface: cairo::ImageSurface,
......@@ -145,6 +145,8 @@ impl FilterContext {
rv
}
/// Returns the <filter> node for this context.
#[inline]
pub fn get_filter_node(&self) -> RsvgNode {
self.node.clone()
}
......
......@@ -79,6 +79,8 @@ impl Primitive {
}
}
/// Computes and returns the filter primitive bounds.
#[inline]
fn get_bounds(&self, ctx: &FilterContext) -> IRect {
let node = ctx.get_filter_node();
let cascaded = node.get_cascaded_values();
......@@ -138,6 +140,7 @@ impl PrimitiveWithInput {
}
/// Returns the input Cairo surface for this filter primitive.
#[inline]
fn get_input(&self, ctx: &FilterContext) -> Option<FilterOutput> {
ctx.get_input(self.in_.borrow().as_ref())
}
......
......@@ -11,6 +11,7 @@ use node::{boxed_node_new, NodeResult, NodeTrait, NodeType, RsvgNode};
use parsers::{parse, Parse};
use property_bag::PropertyBag;
/// The <filter> node.
pub struct NodeFilter {
pub x: Cell<RsvgLength>,
pub y: Cell<RsvgLength>,
......@@ -21,6 +22,8 @@ pub struct NodeFilter {
}
impl NodeFilter {
/// Constructs a new `NodeFilter` with default properties.
#[inline]
fn new() -> Self {
Self {
x: Cell::new(RsvgLength::parse("-10%", LengthDir::Horizontal).unwrap()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment