Merge branch 'worktree-agent-ac8a7f92cb4bb8f58' into claude/practical-noether-1hb2s1
This commit is contained in:
12 files changed
+323
-30
No files matched your search
@@ -1583,7 +1583,7 @@ fn autodim_shift(c: &Ctx, d: &Drawing2D, scale: f64) -> f64 {
|
||||
let prefix = format!("autodim-{}-", d.level_id);
|
||||
let Some(rest) = d.id.strip_prefix(&prefix) else { return 0.0 };
|
||||
let Some((side, _)) = rest.rsplit_once('-') else { return 0.0 };
|
||||
if side == "arc" || side.starts_with("arc-") {
|
||||
if side == "arc" || side.starts_with("arc-") || side == "radius" || side.starts_with("radius-") {
|
||||
return 0.0;
|
||||
}
|
||||
let obst = super::context::excavation_segments(c);
|
||||
|
||||
@@ -226,12 +226,15 @@ impl DimOpts {
|
||||
}
|
||||
}
|
||||
|
||||
/// Kette einer automatischen Aussenbemassung (`openings`, `steps`, `total`, `arc`); `None` = eigene Bemassung.
|
||||
/// Kette einer automatischen Aussenbemassung (`openings`, `steps`, `total`, `arc`, `radius`); `None` = eigene Bemassung.
|
||||
pub fn autodim_chain(d: &Drawing2D) -> Option<&str> {
|
||||
let rest = d.id.strip_prefix("autodim-")?.strip_prefix(d.level_id.as_str())?.strip_prefix('-')?;
|
||||
if rest.starts_with("arc-") {
|
||||
return Some("arc");
|
||||
}
|
||||
if rest.starts_with("radius-") {
|
||||
return Some("radius");
|
||||
}
|
||||
rest.rsplit_once('-').map(|(_, c)| c).filter(|c| matches!(*c, "openings" | "steps" | "total"))
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ fn kette_aus_der_id() {
|
||||
assert_eq!(autodim_chain(&d("autodim-eg-south2-total", "eg")), Some("total"));
|
||||
assert_eq!(autodim_chain(&d("autodim-eg-oblique1-steps", "eg")), Some("steps"));
|
||||
assert_eq!(autodim_chain(&d("autodim-eg-arc-wand-3", "eg")), Some("arc"));
|
||||
assert_eq!(autodim_chain(&d("autodim-eg-radius-wand-3", "eg")), Some("radius"));
|
||||
assert_eq!(autodim_chain(&d("autodim-eg-south-total", "og")), None, "andere Ebene");
|
||||
assert_eq!(autodim_chain(&d("massk-1", "eg")), None);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user