|
@@ -6,7 +6,7 @@
|
|
//! - **Layout**: given minimum sizes and net size policies from the arrangement step, computes
|
|
//! - **Layout**: given minimum sizes and net size policies from the arrangement step, computes
|
|
//! exact pixel values for positions and sizes.
|
|
//! exact pixel values for positions and sizes.
|
|
|
|
|
|
-use std::{ops::Deref, rc::Rc};
|
|
|
|
|
|
+use std::{ops::Deref, rc::Rc, collections::HashMap};
|
|
|
|
|
|
use cache::{Layer, LayoutCacheKey, NodeState};
|
|
use cache::{Layer, LayoutCacheKey, NodeState};
|
|
use kahlo::math::{PixelBox, PixelSideOffsets};
|
|
use kahlo::math::{PixelBox, PixelSideOffsets};
|
|
@@ -152,7 +152,7 @@ impl Deref for ChildArrangement {
|
|
Self::Custom(calc) => calc.as_ref(),
|
|
Self::Custom(calc) => calc.as_ref(),
|
|
Self::Column => &arr::LineArrangement::Column,
|
|
Self::Column => &arr::LineArrangement::Column,
|
|
Self::Row => &arr::LineArrangement::Row,
|
|
Self::Row => &arr::LineArrangement::Row,
|
|
- Self::Table => todo!(),
|
|
|
|
|
|
+ Self::Table => &arr::TableArrangement,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -178,6 +178,8 @@ pub struct LayoutNode {
|
|
valign: VerticalAlignment,
|
|
valign: VerticalAlignment,
|
|
/// User-exposed margins, or spacing between the parent and the render area of this node.
|
|
/// User-exposed margins, or spacing between the parent and the render area of this node.
|
|
margin: PixelSideOffsets,
|
|
margin: PixelSideOffsets,
|
|
|
|
+ /// Table row/column assignment for child nodes, coordinates stored as (row, column).
|
|
|
|
+ table_cells: Option<HashMap<(usize, usize), LayoutCacheKey>>,
|
|
}
|
|
}
|
|
|
|
|
|
impl std::fmt::Debug for LayoutNode {
|
|
impl std::fmt::Debug for LayoutNode {
|
|
@@ -209,6 +211,7 @@ impl LayoutNode {
|
|
halign: HorizontalAlignment::default(),
|
|
halign: HorizontalAlignment::default(),
|
|
valign: VerticalAlignment::default(),
|
|
valign: VerticalAlignment::default(),
|
|
margin: PixelSideOffsets::new_all_same(0),
|
|
margin: PixelSideOffsets::new_all_same(0),
|
|
|
|
+ table_cells: None,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -329,6 +332,7 @@ impl Clone for LayoutNode {
|
|
halign: self.halign,
|
|
halign: self.halign,
|
|
valign: self.valign,
|
|
valign: self.valign,
|
|
margin: self.margin,
|
|
margin: self.margin,
|
|
|
|
+ table_cells: self.table_cells.clone(),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -372,7 +376,6 @@ fn dump_node_tree_helper(lna: LayoutNodeAccess, indent: usize, out: &mut String)
|
|
}
|
|
}
|
|
|
|
|
|
pub fn dump_node_tree(lna: LayoutNodeAccess, out: &mut String) {
|
|
pub fn dump_node_tree(lna: LayoutNodeAccess, out: &mut String) {
|
|
- out.clear();
|
|
|
|
dump_node_tree_helper(lna, 0, out);
|
|
dump_node_tree_helper(lna, 0, out);
|
|
}
|
|
}
|
|
|
|
|