|
|
@ -334,7 +334,9 @@ impl<'a> TextAnnotations<'a> {
|
|
|
|
layer: &'a [InlineAnnotation],
|
|
|
|
layer: &'a [InlineAnnotation],
|
|
|
|
highlight: Option<Highlight>,
|
|
|
|
highlight: Option<Highlight>,
|
|
|
|
) -> &mut Self {
|
|
|
|
) -> &mut Self {
|
|
|
|
|
|
|
|
if !layer.is_empty() {
|
|
|
|
self.inline_annotations.push((layer, highlight).into());
|
|
|
|
self.inline_annotations.push((layer, highlight).into());
|
|
|
|
|
|
|
|
}
|
|
|
|
self
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -349,7 +351,9 @@ impl<'a> TextAnnotations<'a> {
|
|
|
|
/// If multiple layers contain overlay at the same position
|
|
|
|
/// If multiple layers contain overlay at the same position
|
|
|
|
/// the overlay from the layer added last will be show.
|
|
|
|
/// the overlay from the layer added last will be show.
|
|
|
|
pub fn add_overlay(&mut self, layer: &'a [Overlay], highlight: Option<Highlight>) -> &mut Self {
|
|
|
|
pub fn add_overlay(&mut self, layer: &'a [Overlay], highlight: Option<Highlight>) -> &mut Self {
|
|
|
|
|
|
|
|
if !layer.is_empty() {
|
|
|
|
self.overlays.push((layer, highlight).into());
|
|
|
|
self.overlays.push((layer, highlight).into());
|
|
|
|
|
|
|
|
}
|
|
|
|
self
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|