}
impl Border {
- fn default_stroke(self) -> Stroke {
+ pub fn default_stroke(self) -> Stroke {
match self {
Self::InnerFrame(_) | Self::DataLeft | Self::DataTop => Stroke::Thick,
Self::Dimensions(side) if side != RowColBorder::RowVert => Stroke::Solid,
_ => Stroke::None,
}
}
- fn default_border_style(self) -> BorderStyle {
+ pub fn default_border_style(self) -> BorderStyle {
BorderStyle {
stroke: self.default_stroke(),
color: Color::BLACK,
pub struct AxisIterator<'a> {
axis: &'a Axis,
indexes: SmallVec<[usize; 4]>,
+ done: bool,
}
impl<'a> Iterator for AxisIterator<'a> {
fn next(&mut self) -> Option<Self::Item> {
if self.indexes.is_empty() {
- if self
- .axis
- .dimensions
- .iter()
- .any(|dimension| dimension.is_empty())
+ if self.done
+ || self
+ .axis
+ .dimensions
+ .iter()
+ .any(|dimension| dimension.is_empty())
{
- return None;
+ None
+ } else {
+ self.done = true;
+ self.indexes = smallvec![0; self.axis.dimensions.len()];
+ Some(self.indexes.clone())
}
- self.indexes = smallvec![0; self.axis.dimensions.len()];
- Some(self.indexes.clone())
} else {
for (index, dimension) in self.indexes.iter_mut().zip(self.axis.dimensions.iter()) {
*index += 1;
AxisIterator {
axis: self,
indexes: SmallVec::new(),
+ done: false,
}
}
}
}
impl Color {
- const BLACK: Color = Color::new(0, 0, 0);
- const WHITE: Color = Color::new(255, 255, 255);
- const TRANSPARENT: Color = Color::new(0, 0, 0).with_alpha(0);
+ pub const BLACK: Color = Color::new(0, 0, 0);
+ pub const WHITE: Color = Color::new(255, 255, 255);
+ pub const TRANSPARENT: Color = Color::new(0, 0, 0).with_alpha(0);
const fn new(r: u8, g: u8, b: u8) -> Self {
Self {
fixed_indexes: &[usize],
fixed_axis: Axis3,
) -> bool {
+ dbg!();
let vary_axis = fixed_axis.transpose().unwrap();
- let mut cursor2 = self.axes[vary_axis].iter();
- while let Some(vary_indexes) = cursor2.next() {
+ for vary_indexes in self.axes[vary_axis].iter() {
let mut presentation_indexes = enum_map! {
Axis3::Z => layer_indexes,
_ => fixed_indexes,
presentation_indexes[vary_axis] = &vary_indexes;
let data_indexes = self.convert_indexes_ptod(presentation_indexes);
if self.get(&data_indexes).is_some() {
+ dbg!();
return false;
}
}
+ dbg!();
true
}
fn enumerate_axis(
0..body.n.y(),
);
- if stub.x() > 0 {
- body.h_line(Border::DataTop, 0..body.n.x(), stub.y());
- body.v_line(Border::DataLeft, stub.x(), 0..body.n.y());
- }
+ body.h_line(Border::DataTop, 0..body.n.x(), stub.y());
+ body.v_line(Border::DataLeft, stub.x(), 0..body.n.y());
}
body
}
// +-----+-----+-----+-----+-----+-----+-----+-----+-----+
// ```
if c.parent().is_some_and(|parent| parent.show_label.is_some()) {
- table.draw_line(
- Border::Categories(col_horz),
- (h, top_row),
- h_ofs..table.n[h],
- );
+ table.draw_line(Border::Categories(col_horz), (h, y1), h_ofs..table.n[h]);
}
}
}