Remove undocumented and dysfunctional PathLayout

This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
This commit is contained in:
Simon Hausmann 2023-01-19 15:45:33 +01:00 committed by Simon Hausmann
parent 587c9f6942
commit 629c7ed80e
22 changed files with 16 additions and 663 deletions

View file

@ -20,7 +20,6 @@ pub enum Orientation {
#[derive(Clone, Debug, derive_more::From)]
pub enum Layout {
GridLayout(GridLayout),
PathLayout(PathLayout),
BoxLayout(BoxLayout),
}
@ -29,21 +28,18 @@ impl Layout {
match self {
Layout::GridLayout(g) => &g.geometry.rect,
Layout::BoxLayout(g) => &g.geometry.rect,
Layout::PathLayout(p) => &p.rect,
}
}
pub fn rect_mut(&mut self) -> &mut LayoutRect {
match self {
Layout::GridLayout(g) => &mut g.geometry.rect,
Layout::BoxLayout(g) => &mut g.geometry.rect,
Layout::PathLayout(p) => &mut p.rect,
}
}
pub fn geometry(&self) -> Option<&LayoutGeometry> {
pub fn geometry(&self) -> &LayoutGeometry {
match self {
Layout::GridLayout(l) => Some(&l.geometry),
Layout::BoxLayout(l) => Some(&l.geometry),
Layout::PathLayout(_) => None,
Layout::GridLayout(l) => &l.geometry,
Layout::BoxLayout(l) => &l.geometry,
}
}
}
@ -54,7 +50,6 @@ impl Layout {
match self {
Layout::GridLayout(grid) => grid.visit_named_references(visitor),
Layout::BoxLayout(l) => l.visit_named_references(visitor),
Layout::PathLayout(path) => path.visit_named_references(visitor),
}
}
}
@ -451,22 +446,6 @@ impl BoxLayout {
}
}
/// Internal representation of a path layout
#[derive(Debug, Clone)]
pub struct PathLayout {
pub path: Path,
pub elements: Vec<ElementRc>,
pub rect: LayoutRect,
pub offset_reference: Option<NamedReference>,
}
impl PathLayout {
fn visit_named_references(&mut self, visitor: &mut impl FnMut(&mut NamedReference)) {
self.rect.visit_named_references(visitor);
self.offset_reference.as_mut().map(visitor);
}
}
/// The [`Type`] for a runtime LayoutInfo structure
pub fn layout_info_type() -> Type {
Type::Struct {