Preserve inset line alignment in PPTX

This commit is contained in:
Harrison Booth
2026-10-30 22:48:31 -05:00
parent eaeb06c655
commit 727b682d17
4 changed files with 54 additions and 3 deletions
+30
View File
@@ -232,6 +232,34 @@ pub enum LineJoin {
Miter,
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum LineAlign {
#[default]
Center,
Inside,
Outside,
}
impl LineAlign {
pub fn xml(self) -> &'static str {
match self {
LineAlign::Center => "ctr",
LineAlign::Inside => "in",
LineAlign::Outside => "out",
}
}
pub fn from_xml(value: &str) -> Option<Self> {
match value {
"ctr" => Some(LineAlign::Center),
"in" => Some(LineAlign::Inside),
"out" => Some(LineAlign::Outside),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Compound {
@@ -324,6 +352,7 @@ pub struct Line {
pub dash: Option<Dash>,
pub cap: Option<LineCap>,
pub join: Option<LineJoin>,
pub align: Option<LineAlign>,
pub compound: Option<Compound>,
pub head: Option<LineEnd>,
pub tail: Option<LineEnd>,
@@ -347,6 +376,7 @@ impl Line {
}
self.cap = self.cap.or(parent.cap);
self.join = self.join.or(parent.join);
self.align = self.align.or(parent.align);
self.compound = self.compound.or(parent.compound);
if self.head.is_none() {
self.head.clone_from(&parent.head);