Skip to main content

lichtung_plot/canvas/
text_clear.rs

1//! Canvas-root prose shares Text's independent instruction removal.
2
3use super::Canvas;
4
5macro_rules! clear_slot {
6    ($style:ident, $layout:ident, $field:ident) => {
7        impl Canvas {
8            #[doc = concat!("Remove the local root `", stringify!($field), "` appearance override without changing content/layout or child plots.")]
9            #[must_use]
10            pub fn $style(mut self) -> Self {
11                self.$field.edit_clear_style();
12                self
13            }
14            #[doc = concat!("Remove the local root `", stringify!($field), "` layout request without changing content/style or child plots.")]
15            #[must_use]
16            pub fn $layout(mut self) -> Self {
17                self.$field.edit_clear_layout();
18                self
19            }
20        }
21    };
22}
23
24clear_slot!(clear_title_style, clear_title_layout, title);
25clear_slot!(clear_subtitle_style, clear_subtitle_layout, subtitle);
26clear_slot!(clear_caption_style, clear_caption_layout, caption);