working on a used text_svg in the presenter

This commit is contained in:
Chris Cochrun 2025-04-04 23:29:28 -05:00
parent 010f9a41d8
commit 342485f9d2
5 changed files with 20 additions and 7 deletions

View file

@ -11,6 +11,8 @@ use cosmic::{
};
use tracing::{debug, error};
use crate::TextAlignment;
#[derive(Clone, Debug, Default, PartialEq)]
pub struct TextSvg {
text: String,
@ -18,6 +20,7 @@ pub struct TextSvg {
shadow: Option<Shadow>,
stroke: Option<Stroke>,
fill: Color,
alignment: TextAlignment,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
@ -175,6 +178,11 @@ impl TextSvg {
self
}
pub fn alignment(mut self, alignment: TextAlignment) -> Self {
self.alignment = alignment;
self
}
pub fn view<'a>(self) -> Element<'a, Message> {
let shadow = if let Some(shadow) = &self.shadow {
format!("<filter id=\"shadow\"><feDropShadow dx=\"{}\" dy=\"{}\" stdDeviation=\"{}\" flood-color=\"{}\"/></filter>",