diff options
Diffstat (limited to 'library/src/meta/figure.rs')
| -rw-r--r-- | library/src/meta/figure.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/library/src/meta/figure.rs b/library/src/meta/figure.rs index 964bb4ec..a838b9a5 100644 --- a/library/src/meta/figure.rs +++ b/library/src/meta/figure.rs @@ -173,14 +173,14 @@ impl Synthesize for FigureElem { // Determine the figure's kind. let kind = match self.kind(styles) { Smart::Auto => self - .find_figurable(styles) + .find_figurable(vt, styles) .map(|elem| FigureKind::Elem(elem.func())) .unwrap_or_else(|| FigureKind::Elem(ImageElem::func())), Smart::Custom(kind) => kind, }; let content = match &kind { - FigureKind::Elem(func) => self.find_of_elem(*func), + FigureKind::Elem(func) => self.find_of_elem(vt, *func), FigureKind::Name(_) => None, } .unwrap_or_else(|| self.body()); @@ -303,9 +303,9 @@ impl Refable for FigureElem { impl FigureElem { /// Determines the type of the figure by looking at the content, finding all /// [`Figurable`] elements and sorting them by priority then returning the highest. - pub fn find_figurable(&self, styles: StyleChain) -> Option<Content> { + pub fn find_figurable(&self, vt: &Vt, styles: StyleChain) -> Option<Content> { self.body() - .query(Selector::can::<dyn Figurable>()) + .query(vt.introspector, Selector::can::<dyn Figurable>()) .into_iter() .max_by_key(|elem| elem.with::<dyn Figurable>().unwrap().priority(styles)) .cloned() @@ -313,9 +313,9 @@ impl FigureElem { /// Finds the element with the given function in the figure's content. /// Returns `None` if no element with the given function is found. - pub fn find_of_elem(&self, func: ElemFunc) -> Option<Content> { + pub fn find_of_elem(&self, vt: &Vt, func: ElemFunc) -> Option<Content> { self.body() - .query(Selector::Elem(func, None)) + .query(vt.introspector, Selector::Elem(func, None)) .into_iter() .next() .cloned() |
