From a91cafce43bbdcbbe15b6abec15430477d8f9a27 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 12:47:43 +0100 Subject: [PATCH] thing-core: a Px length in Cells is cells at the 8x16 cell metric, one adapter Ruling cells-px-metric. Device::length is the one adapter that turns a document's Px length into device units: times the scale in Pixels, divided by the cell metric (8 across, 16 down) in Cells, per axis, with Taffy's rounding landing it on a cell. A flex basis runs along its parent's main axis. CELL_PX is the one constant: the Image extent in CellMeasure reads it instead of its own 8 and 16. The thing-tui screen goldens run the shared fixtures unedited (as_cells deleted), so f03, f08, f11 and every other Cells golden are re-blessed from them. Co-Authored-By: Claude Sonnet 5.5 --- crates/thing-core/src/layout/measure.rs | 30 +- crates/thing-core/src/layout/mod.rs | 4 +- crates/thing-core/src/layout/style.rs | 90 +- crates/thing-core/src/layout/tree.rs | 21 +- crates/thing-core/src/text/cells.rs | 4 +- .../layout-f01-swarm-dashboard-cells.txt | 14 +- .../render-f01-swarm-dashboard-cells.txt | 16 +- .../goldens/render-f12-text-edge-cells.txt | 57 +- crates/thing-core/tests/layout.rs | 38 + crates/thing-core/tests/render.rs | 18 +- .../screen-f01-swarm-dashboard-cells.txt | 107 +- .../goldens/screen-f02-login-effect-cells.txt | 44 +- .../goldens/screen-f03-input-target-cells.txt | 16 +- .../tests/goldens/screen-f04-form-cells.txt | 50 +- .../screen-f05-modal-overlay-cells.txt | 124 +- .../goldens/screen-f06-scroll-list-cells.txt | 128 +- .../tests/goldens/screen-f07-plot-cells.txt | 194 +-- .../screen-f08-embed-viewport-cells.txt | 18 +- .../screen-f09-composition-stack-cells.txt | 65 +- .../goldens/screen-f10-hostile-cells.txt | 32 +- .../tests/goldens/screen-f11-deep-cells.txt | 1036 ++--------------- .../goldens/screen-f12-text-edge-cells.txt | 71 +- crates/thing-tui/tests/screen.rs | 48 +- 23 files changed, 697 insertions(+), 1528 deletions(-) diff --git a/crates/thing-core/src/layout/measure.rs b/crates/thing-core/src/layout/measure.rs index 3ccd1ac..4683fef 100644 --- a/crates/thing-core/src/layout/measure.rs +++ b/crates/thing-core/src/layout/measure.rs @@ -114,8 +114,21 @@ pub fn cells_inset(height: f32) -> (f32, f32) { (1.0, if height >= 3.0 { 1.0 } else { 0.0 }) } +/// Device px per cell, `(across, down)`: the metric a terminal cell stands for. In Cells mode a Px +/// length converts at it (8 wide, 16 tall), and an Image's pixel extent is read in cells at it. +pub(crate) const CELL_PX: (f32, f32) = (8.0, 16.0); + +/// The axis a Px length runs along: across (width, left and right, columns) or down (height, top +/// and bottom, rows). A cell is not square, so a Px length converts per axis in Cells. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(super) enum Axis { + X, + Y, +} + /// The one place logical units become device units and back: `k` device px per logical px -/// (1 in Cells). Everything past this adapter, the style map and the solver included, is device. +/// (1 in Cells, where `length` divides a Px length by the cell metric instead). Everything past +/// this adapter, the style map and the solver included, is device. #[derive(Clone, Copy, Debug)] pub(super) struct Device { k: f32, @@ -143,10 +156,25 @@ impl Device { if self.cells { (38.0, 10.0) } else { (self.px(300.0), self.px(150.0)) } } + /// A viewport side or a measured size in device units: logical px times the scale, or cells + /// as they are (a Measure answers in cells in Cells). pub(super) fn px(self, logical: f32) -> f32 { logical * self.k } + /// A Px length of the document in device units along `axis`: times the scale in Pixels, divided + /// by the cell metric in Cells. Taffy's rounding then lands it on a device pixel or a cell. + pub(super) fn length(self, px: f32, axis: Axis) -> f32 { + if self.cells { + px / match axis { + Axis::X => CELL_PX.0, + Axis::Y => CELL_PX.1, + } + } else { + px * self.k + } + } + fn logical(self, device: f32) -> f32 { device / self.k } diff --git a/crates/thing-core/src/layout/mod.rs b/crates/thing-core/src/layout/mod.rs index edb1b29..a69b158 100644 --- a/crates/thing-core/src/layout/mod.rs +++ b/crates/thing-core/src/layout/mod.rs @@ -4,7 +4,7 @@ //! //! Pixels mode runs the solver in device pixels (every Px length and every measured size is //! multiplied by the scale factor at the one adapter) with Taffy's cumulative rounding, so every -//! edge lands on a device pixel and adjacent boxes share it. Cells mode ignores the scale. The +//! edge lands on a device pixel and adjacent boxes share it. Cells mode ignores the scale and converts a Px length at the cell metric (8x16 device px per cell). The //! viewport is a block container the document root flows in, and is not itself in the output. //! Overlays are out of flow: after the main pass each is laid out as its own root against its anchor //! and appended after every main-tree node. @@ -19,7 +19,7 @@ use measure::Device; use thing_contract::{NodeId, OverlayNode}; pub use measure::{Avail, CellStyle, cells_inset, Constraint, FontId, Glyph, Leaf, Measure, Run, TextLayout, TextLine, TextRequest}; -pub(crate) use measure::MAX_DEVICE; +pub(crate) use measure::{CELL_PX, MAX_DEVICE}; use crate::bind::BoundTree; use crate::diagnostic::{Code, Diagnostic}; diff --git a/crates/thing-core/src/layout/style.rs b/crates/thing-core/src/layout/style.rs index 6816c35..23e6eb2 100644 --- a/crates/thing-core/src/layout/style.rs +++ b/crates/thing-core/src/layout/style.rs @@ -13,7 +13,7 @@ use taffy::{ }; use thing_contract as c; -use super::measure::{Device, MAX_DEVICE}; +use super::measure::{Axis, Device, MAX_DEVICE}; /// Field names of the slots that took their initial value. pub(super) type Invalid = Vec<&'static str>; @@ -23,34 +23,34 @@ fn number(value: f64, negative: bool) -> Option { fits.then_some(value as f32) } -fn length(scalar: &c::Scalar, dev: Device, negative: bool) -> Option { - number(scalar.value, negative).map(|v| dev.px(v)).filter(|v| v.abs() <= MAX_DEVICE) +fn length(scalar: &c::Scalar, dev: Device, axis: Axis, negative: bool) -> Option { + number(scalar.value, negative).map(|v| dev.length(v, axis)).filter(|v| v.abs() <= MAX_DEVICE) } fn percent(scalar: &c::Scalar, negative: bool) -> Option { number(scalar.value, negative).map(|v| v / 100.0) } -fn lp(d: &c::Dimension, dev: Device) -> Option { +fn lp(d: &c::Dimension, dev: Device, axis: Axis) -> Option { match d { - c::Dimension::Px(s) => length(s, dev, false).map(LengthPercentage::length), + c::Dimension::Px(s) => length(s, dev, axis, false).map(LengthPercentage::length), c::Dimension::Percent(s) => percent(s, false).map(LengthPercentage::percent), _ => None, } } -fn lpa(d: &c::Dimension, dev: Device, negative: bool) -> Option { +fn lpa(d: &c::Dimension, dev: Device, axis: Axis, negative: bool) -> Option { match d { - c::Dimension::Px(s) => length(s, dev, negative).map(LengthPercentageAuto::length), + c::Dimension::Px(s) => length(s, dev, axis, negative).map(LengthPercentageAuto::length), c::Dimension::Percent(s) => percent(s, negative).map(LengthPercentageAuto::percent), c::Dimension::Auto => Some(LengthPercentageAuto::auto()), _ => None, } } -fn size_dim(d: &c::Dimension, dev: Device) -> Option { +fn size_dim(d: &c::Dimension, dev: Device, axis: Axis) -> Option { match d { - c::Dimension::Px(s) => length(s, dev, false).map(Dimension::length), + c::Dimension::Px(s) => length(s, dev, axis, false).map(Dimension::length), c::Dimension::Percent(s) => percent(s, false).map(Dimension::percent), c::Dimension::Auto => Some(Dimension::auto()), c::Dimension::Content => Some(Dimension::fit_content()), @@ -58,20 +58,20 @@ fn size_dim(d: &c::Dimension, dev: Device) -> Option { } } -fn basis_dim(d: &c::Dimension, dev: Device) -> Option { +fn basis_dim(d: &c::Dimension, dev: Device, axis: Axis) -> Option { match d { c::Dimension::Content => Some(Dimension::content()), c::Dimension::Fr(_) => None, - other => size_dim(other, dev), + other => size_dim(other, dev, axis), } } -fn track(d: &c::Dimension, dev: Device) -> Option> { +fn track(d: &c::Dimension, dev: Device, axis: Axis) -> Option> { use MaxTrackSizingFunction as Max; use MinTrackSizingFunction as Min; let (min, max) = match d { c::Dimension::Px(s) => { - let v = length(s, dev, false)?; + let v = length(s, dev, axis, false)?; (Min::length(v), Max::length(v)) } c::Dimension::Percent(s) => { @@ -103,16 +103,16 @@ impl Slots { fn size2(&mut self, field: &'static str, s: &c::Size2) -> Size { let dev = self.dev; Size { - width: self.take(field, size_dim(&s.width, dev), Dimension::auto()), - height: self.take(field, size_dim(&s.height, dev), Dimension::auto()), + width: self.take(field, size_dim(&s.width, dev, Axis::X), Dimension::auto()), + height: self.take(field, size_dim(&s.height, dev, Axis::Y), Dimension::auto()), } } fn size2_lpa(&mut self, field: &'static str, s: &c::Size2) -> Size { let dev = self.dev; Size { - width: self.take(field, lpa(&s.width, dev, false), LengthPercentageAuto::auto()), - height: self.take(field, lpa(&s.height, dev, false), LengthPercentageAuto::auto()), + width: self.take(field, lpa(&s.width, dev, Axis::X, false), LengthPercentageAuto::auto()), + height: self.take(field, lpa(&s.height, dev, Axis::Y, false), LengthPercentageAuto::auto()), } } @@ -125,10 +125,10 @@ impl Slots { ) -> Rect { let dev = self.dev; Rect { - left: self.take(field, lpa(&e.left, dev, negative), initial), - right: self.take(field, lpa(&e.right, dev, negative), initial), - top: self.take(field, lpa(&e.top, dev, negative), initial), - bottom: self.take(field, lpa(&e.bottom, dev, negative), initial), + left: self.take(field, lpa(&e.left, dev, Axis::X, negative), initial), + right: self.take(field, lpa(&e.right, dev, Axis::X, negative), initial), + top: self.take(field, lpa(&e.top, dev, Axis::Y, negative), initial), + bottom: self.take(field, lpa(&e.bottom, dev, Axis::Y, negative), initial), } } @@ -136,16 +136,16 @@ impl Slots { let dev = self.dev; let zero = LengthPercentage::ZERO; Rect { - left: self.take(field, lp(&e.left, dev), zero), - right: self.take(field, lp(&e.right, dev), zero), - top: self.take(field, lp(&e.top, dev), zero), - bottom: self.take(field, lp(&e.bottom, dev), zero), + left: self.take(field, lp(&e.left, dev, Axis::X), zero), + right: self.take(field, lp(&e.right, dev, Axis::X), zero), + top: self.take(field, lp(&e.top, dev, Axis::Y), zero), + bottom: self.take(field, lp(&e.bottom, dev, Axis::Y), zero), } } - fn tracks(&mut self, field: &'static str, dims: &[c::Dimension]) -> Vec> { + fn tracks(&mut self, field: &'static str, axis: Axis, dims: &[c::Dimension]) -> Vec> { let dev = self.dev; - let tracks: Option> = dims.iter().map(|d| track(d, dev)).collect(); + let tracks: Option> = dims.iter().map(|d| track(d, dev, axis)).collect(); self.take(field, tracks, Vec::new()) } @@ -179,7 +179,9 @@ fn content(align: &c::ContentAlign, auto: AlignContent) -> AlignContent { } /// The Taffy style of a Box. `dev` converts Px lengths to the solver's device units; the slots that were not legal are named in the second value. -pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Style, Invalid) { +/// `main` is the main axis of the flex container this box is a child of: a flex basis runs along +/// its parent's main axis, not the box's own. +pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device, main: Axis) -> (Style, Invalid) { let c::BoxStyle { display, direction, @@ -204,11 +206,15 @@ pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Styl grid_rows, } = s; let mut slots = Slots { dev, invalid: Vec::new() }; - let border = match &paint.border { - None => LengthPercentage::ZERO, + // A border is one width on four sides: across (left, right) and down (top, bottom) it + // converts at its own axis. + let (border_x, border_y) = match &paint.border { + None => (LengthPercentage::ZERO, LengthPercentage::ZERO), Some(b) => { - let width = slots.take("border", length(&c::Scalar { value: b.width }, dev, false), 0.0); - LengthPercentage::length(width) + let width = c::Scalar { value: b.width }; + let across = slots.take("border", length(&width, dev, Axis::X, false), 0.0); + let down = length(&width, dev, Axis::Y, false).unwrap_or(0.0); + (LengthPercentage::length(across), LengthPercentage::length(down)) } }; let overflow = match overflow { @@ -217,8 +223,8 @@ pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Styl c::Overflow::Scroll => TOverflow::Scroll, }; let gap = { - let width = slots.take("gap", lp(&gap.width, dev), LengthPercentage::ZERO); - let height = slots.take("gap", lp(&gap.height, dev), LengthPercentage::ZERO); + let width = slots.take("gap", lp(&gap.width, dev, Axis::X), LengthPercentage::ZERO); + let height = slots.take("gap", lp(&gap.height, dev, Axis::Y), LengthPercentage::ZERO); Size { width, height } }; let style = Style { @@ -240,7 +246,7 @@ pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Styl }, gap, padding: slots.edges_lp("padding", padding), - border: Rect { left: border, right: border, top: border, bottom: border }, + border: Rect { left: border_x, right: border_x, top: border_y, bottom: border_y }, margin: slots.edges_lpa("margin", margin, true, LengthPercentageAuto::ZERO), size: slots.size2("size", size), min_size: slots.size2_lpa("min_size", min_size), @@ -259,11 +265,11 @@ pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Styl flex_grow: slots.weight("grow", *grow, 0.0), flex_shrink: slots.weight("shrink", *shrink, 1.0), flex_basis: { - let basis = basis_dim(basis, dev); + let basis = basis_dim(basis, dev, main); slots.take("basis", basis, Dimension::auto()) }, - grid_template_columns: slots.tracks("grid_columns", grid_columns).into_iter().collect(), - grid_template_rows: slots.tracks("grid_rows", grid_rows).into_iter().collect(), + grid_template_columns: slots.tracks("grid_columns", Axis::X, grid_columns).into_iter().collect(), + grid_template_rows: slots.tracks("grid_rows", Axis::Y, grid_rows).into_iter().collect(), ..Style::default() }; (style, slots.invalid) @@ -272,12 +278,12 @@ pub(super) fn box_style(s: &c::BoxStyle, paint: &c::Paint, dev: Device) -> (Styl /// An Embed's style: exactly its declared size, never shrunk. pub(super) fn embed_style(width: f64, height: f64, dev: Device) -> (Style, Invalid) { let mut slots = Slots { dev, invalid: Vec::new() }; - let side = |slots: &mut Slots, value: f64| { - let v = slots.take("size", length(&c::Scalar { value }, dev, false), 0.0); + let side = |slots: &mut Slots, value: f64, axis: Axis| { + let v = slots.take("size", length(&c::Scalar { value }, dev, axis, false), 0.0); (Dimension::length(v), LengthPercentageAuto::length(v)) }; - let (w, wa) = side(&mut slots, width); - let (h, ha) = side(&mut slots, height); + let (w, wa) = side(&mut slots, width, Axis::X); + let (h, ha) = side(&mut slots, height, Axis::Y); let style = Style { size: Size { width: w, height: h }, min_size: Size { width: wa, height: ha }, diff --git a/crates/thing-core/src/layout/tree.rs b/crates/thing-core/src/layout/tree.rs index 04de2ff..c91e1ec 100644 --- a/crates/thing-core/src/layout/tree.rs +++ b/crates/thing-core/src/layout/tree.rs @@ -1,9 +1,9 @@ //! The walk: a `BoundTree` becomes a Taffy tree, one Taffy node per laid node, Repeats spliced. use taffy::{Style, TaffyTree}; -use thing_contract::{Node, NodeId, Overflow, OverlayNode}; +use thing_contract::{Direction, Node, NodeId, Overflow, OverlayNode}; -use super::measure::{Device, Leaf, MAX_DEVICE, cells_inset, intrinsic_ratio}; +use super::measure::{Axis, Device, Leaf, MAX_DEVICE, cells_inset, intrinsic_ratio}; use super::style::{Invalid, box_style, embed_style}; use crate::bind::{Bound, BoundTree, Field}; use crate::diagnostic::{Code, Diagnostic}; @@ -41,6 +41,9 @@ struct Builder<'a, 'm> { leaves: Vec>, diagnostics: Vec, overlays: Vec<&'a OverlayNode>, + /// The main axis of the container whose children are being visited: the axis a child's flex + /// basis runs along. The viewport is a block, whose children take no basis; across stands. + main: Axis, } /// What the Taffy tree is rooted at: the viewport holding the document root, or one Overlay. @@ -71,6 +74,7 @@ pub(super) fn build<'a>( leaves: Vec::new(), diagnostics: Vec::new(), overlays: Vec::new(), + main: Axis::X, }; let mut kids = Vec::new(); let mut style = Style { @@ -163,15 +167,18 @@ impl<'a> Builder<'a, '_> { parent: Option, (style, invalid): (Style, Invalid), overflow: &Overflow, + main: Axis, children: &'a [Node], out: &mut Vec, ) { self.report(id, invalid); let index = self.entry(id, parent, overflow); let mut kids = Vec::new(); + let outer = std::mem::replace(&mut self.main, main); for child in children { self.visit(child, Some(index), &mut kids); } + self.main = outer; let node = self.taffy.new_with_children(style, &kids).expect("taffy: insert"); self.entries[index].node = node; out.push(node); @@ -183,8 +190,12 @@ impl<'a> Builder<'a, '_> { grow(|| match node { Node::Box(b) => { if !self.hidden(&b.common.id) { - let style = box_style(&b.style, &b.paint, self.dev); - self.container(&b.common.id, parent, style, &b.style.overflow, &b.children, out); + let style = box_style(&b.style, &b.paint, self.dev, self.main); + let main = match b.style.direction { + Direction::Row | Direction::RowReverse => Axis::X, + Direction::Column | Direction::ColumnReverse => Axis::Y, + }; + self.container(&b.common.id, parent, style, &b.style.overflow, main, &b.children, out); } } Node::Button(b) => { @@ -204,7 +215,7 @@ impl<'a> Builder<'a, '_> { } else { Style::default() }; - self.container(&b.common.id, parent, (style, Vec::new()), &Overflow::Visible, &b.content, out); + self.container(&b.common.id, parent, (style, Vec::new()), &Overflow::Visible, Axis::X, &b.content, out); } } // A Repeat has no box: its instances are its parent's children, in instance order. diff --git a/crates/thing-core/src/text/cells.rs b/crates/thing-core/src/text/cells.rs index 500b73b..b527025 100644 --- a/crates/thing-core/src/text/cells.rs +++ b/crates/thing-core/src/text/cells.rs @@ -17,7 +17,7 @@ use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; use crate::bind::Bound; -use crate::layout::{Avail, CellStyle, Constraint, Leaf, Measure, Run, TextLayout, TextLine, TextRequest}; +use crate::layout::{Avail, CELL_PX, CellStyle, Constraint, Leaf, Measure, Run, TextLayout, TextLine, TextRequest}; /// The tab stop, in columns (CSS `tab-size: 8`). const TAB: u32 = 8; @@ -298,7 +298,7 @@ impl Measure for CellMeasure { Leaf::Slider { .. } => (20.0, 1.0), Leaf::Select { .. } => (20.0, 1.0), Leaf::Image { asset, .. } => match asset { - Bound::Asset(entry) => ((entry.width.get() as f32 / 8.0).ceil(), (entry.height.get() as f32 / 16.0).ceil()), + Bound::Asset(entry) => ((entry.width.get() as f32 / CELL_PX.0).ceil(), (entry.height.get() as f32 / CELL_PX.1).ceil()), _ => (0.0, 0.0), }, } diff --git a/crates/thing-core/tests/goldens/layout-f01-swarm-dashboard-cells.txt b/crates/thing-core/tests/goldens/layout-f01-swarm-dashboard-cells.txt index c331b06..ab92c79 100644 --- a/crates/thing-core/tests/goldens/layout-f01-swarm-dashboard-cells.txt +++ b/crates/thing-core/tests/goldens/layout-f01-swarm-dashboard-cells.txt @@ -1,8 +1,8 @@ surface thing:surface:provider.swarm.dashboard viewport 100x37 scale 1 cells -root 0 0 100 23 -load 2 2 48 1 -minds#6:mind-1/mind-name 54 2 48 1 -minds#6:mind-2/mind-name 2 11 48 1 -minds#6:mind-3/mind-name 54 11 48 1 -restart 2 20 48 1 -restart-label 3 20 46 1 +root 0 0 100 4 +load 0 0 50 1 +minds#6:mind-1/mind-name 51 0 49 1 +minds#6:mind-2/mind-name 0 2 50 1 +minds#6:mind-3/mind-name 51 2 49 1 +restart 0 3 50 1 +restart-label 1 3 48 1 diff --git a/crates/thing-core/tests/goldens/render-f01-swarm-dashboard-cells.txt b/crates/thing-core/tests/goldens/render-f01-swarm-dashboard-cells.txt index e984357..ff2ced7 100644 --- a/crates/thing-core/tests/goldens/render-f01-swarm-dashboard-cells.txt +++ b/crates/thing-core/tests/goldens/render-f01-swarm-dashboard-cells.txt @@ -1,9 +1,9 @@ surface thing:surface:provider.swarm.dashboard viewport 100x37 scale 1 cells -fill 0 0 100 23 r8 #1e1e2eff -text 2 2 #ffffffff cells "42.0%" bold=false italic=false underline=false -text 54 2 #eeeef4ff cells "Eureka" bold=false italic=false underline=false -text 2 11 #eeeef4ff cells "Libby" bold=false italic=false underline=false -text 54 11 #eeeef4ff cells "Kiko" bold=false italic=false underline=false -fill 2 20 48 1 r0 #2c2c3eff -stroke 2 20 48 1 r0 w1 #4a4a60ff -text 3 20 #eeeef4ff cells "Restart" bold=false italic=false underline=false +fill 0 0 100 4 r8 #1e1e2eff +text 0 0 #ffffffff cells "42.0%" bold=false italic=false underline=false +text 51 0 #eeeef4ff cells "Eureka" bold=false italic=false underline=false +text 0 2 #eeeef4ff cells "Libby" bold=false italic=false underline=false +text 51 2 #eeeef4ff cells "Kiko" bold=false italic=false underline=false +fill 0 3 50 1 r0 #2c2c3eff +stroke 0 3 50 1 r0 w1 #4a4a60ff +text 1 3 #eeeef4ff cells "Restart" bold=false italic=false underline=false diff --git a/crates/thing-core/tests/goldens/render-f12-text-edge-cells.txt b/crates/thing-core/tests/goldens/render-f12-text-edge-cells.txt index 1fdbefa..875c195 100644 --- a/crates/thing-core/tests/goldens/render-f12-text-edge-cells.txt +++ b/crates/thing-core/tests/goldens/render-f12-text-edge-cells.txt @@ -1,31 +1,28 @@ surface thing:surface:provider.text.text-edge viewport 40x60 scale 1 cells -text 2 2 #eeeef4ff cells "Hello שלום עולם and مرحبا بالعالم" bold=false italic=false underline=false -text 2 3 #eeeef4ff cells "then 123 end." bold=false italic=false underline=false -text 2 12 #eeeef4ff cells "日本語テスト 你好世界 한국어 ABC" bold=false italic=false underline=false widths=2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,1,2,2,2 -text 2 13 #eeeef4ff cells "123" bold=false italic=false underline=false widths=2,2,2 -text 2 22 #eeeef4ff cells "e\u{301} a\u{308} n\u{303} o\u{302}\u{323} z\u{35b}\u{34f}\u{300}" bold=false italic=false underline=false -text 2 31 #eeeef4ff cells "👩\u{200d}👩\u{200d}👧\u{200d}👦 👨🏽\u{200d}💻 🏳\u{fe0f}\u{200d}🌈" bold=false italic=false underline=false widths=2,1,2,1,2 -text 2 40 #eeeef4ff cells "The quick brown fox jumps over the" bold=false italic=false underline=false -text 2 41 #eeeef4ff cells "lazy dog while the evening light" bold=false italic=false underline=false -text 2 42 #eeeef4ff cells "slides across the valley, and the" bold=false italic=false underline=false -text 2 43 #eeeef4ff cells "long paragraph keeps going so that" bold=false italic=false underline=false -text 2 44 #eeeef4ff cells "any reasonable column must break it" bold=false italic=false underline=false -text 2 45 #eeeef4ff cells "across several lines. The quick" bold=false italic=false underline=false -text 2 46 #eeeef4ff cells "brown fox jumps over the lazy dog" bold=false italic=false underline=false -text 2 47 #eeeef4ff cells "while the evening light slides" bold=false italic=false underline=false -text 2 48 #eeeef4ff cells "across the valley, and the long" bold=false italic=false underline=false -text 2 49 #eeeef4ff cells "paragraph keeps going so that any" bold=false italic=false underline=false -text 2 50 #eeeef4ff cells "reasonable column must break it" bold=false italic=false underline=false -text 2 51 #eeeef4ff cells "across several lines. The quick" bold=false italic=false underline=false -text 2 52 #eeeef4ff cells "brown fox jumps over the lazy dog" bold=false italic=false underline=false -text 2 53 #eeeef4ff cells "while the evening light slides" bold=false italic=false underline=false -text 2 54 #eeeef4ff cells "across the valley, and the long" bold=false italic=false underline=false -text 2 55 #eeeef4ff cells "paragraph keeps going so that any" bold=false italic=false underline=false -text 2 56 #eeeef4ff cells "reasonable column must break it" bold=false italic=false underline=false -text 2 57 #eeeef4ff cells "across several lines. The quick" bold=false italic=false underline=false -text 2 58 #eeeef4ff cells "brown fox jumps over the lazy dog" bold=false italic=false underline=false -text 2 59 #eeeef4ff cells "while the evening light slides" bold=false italic=false underline=false -text 2 60 #eeeef4ff cells "across the valley, and the long" bold=false italic=false underline=false -text 2 61 #eeeef4ff cells "paragraph keeps going so that any" bold=false italic=false underline=false -text 2 62 #eeeef4ff cells "reasonable column must break it" bold=false italic=false underline=false -text 2 63 #eeeef4ff cells "across several lines. " bold=false italic=false underline=false +text 0 0 #eeeef4ff cells "Hello שלום עולם and مرحبا بالعالم then" bold=false italic=false underline=false +text 0 1 #eeeef4ff cells "123 end." bold=false italic=false underline=false +text 0 3 #eeeef4ff cells "日本語テスト 你好世界 한국어 ABC12" bold=false italic=false underline=false widths=2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,1,2,2,2,2,2 +text 0 4 #eeeef4ff cells "3" bold=false italic=false underline=false widths=2 +text 0 5 #eeeef4ff cells "e\u{301} a\u{308} n\u{303} o\u{302}\u{323} z\u{35b}\u{34f}\u{300}" bold=false italic=false underline=false +text 0 7 #eeeef4ff cells "👩\u{200d}👩\u{200d}👧\u{200d}👦 👨🏽\u{200d}💻 🏳\u{fe0f}\u{200d}🌈" bold=false italic=false underline=false widths=2,1,2,1,2 +text 0 8 #eeeef4ff cells "The quick brown fox jumps over the lazy" bold=false italic=false underline=false +text 0 9 #eeeef4ff cells "dog while the evening light slides" bold=false italic=false underline=false +text 0 10 #eeeef4ff cells "across the valley, and the long" bold=false italic=false underline=false +text 0 11 #eeeef4ff cells "paragraph keeps going so that any" bold=false italic=false underline=false +text 0 12 #eeeef4ff cells "reasonable column must break it across" bold=false italic=false underline=false +text 0 13 #eeeef4ff cells "several lines. The quick brown fox jumps" bold=false italic=false underline=false +text 0 14 #eeeef4ff cells "over the lazy dog while the evening" bold=false italic=false underline=false +text 0 15 #eeeef4ff cells "light slides across the valley, and the" bold=false italic=false underline=false +text 0 16 #eeeef4ff cells "long paragraph keeps going so that any" bold=false italic=false underline=false +text 0 17 #eeeef4ff cells "reasonable column must break it across" bold=false italic=false underline=false +text 0 18 #eeeef4ff cells "several lines. The quick brown fox jumps" bold=false italic=false underline=false +text 0 19 #eeeef4ff cells "over the lazy dog while the evening" bold=false italic=false underline=false +text 0 20 #eeeef4ff cells "light slides across the valley, and the" bold=false italic=false underline=false +text 0 21 #eeeef4ff cells "long paragraph keeps going so that any" bold=false italic=false underline=false +text 0 22 #eeeef4ff cells "reasonable column must break it across" bold=false italic=false underline=false +text 0 23 #eeeef4ff cells "several lines. The quick brown fox jumps" bold=false italic=false underline=false +text 0 24 #eeeef4ff cells "over the lazy dog while the evening" bold=false italic=false underline=false +text 0 25 #eeeef4ff cells "light slides across the valley, and the" bold=false italic=false underline=false +text 0 26 #eeeef4ff cells "long paragraph keeps going so that any" bold=false italic=false underline=false +text 0 27 #eeeef4ff cells "reasonable column must break it across" bold=false italic=false underline=false +text 0 28 #eeeef4ff cells "several lines. " bold=false italic=false underline=false diff --git a/crates/thing-core/tests/layout.rs b/crates/thing-core/tests/layout.rs index aba42b1..6af081d 100644 --- a/crates/thing-core/tests/layout.rs +++ b/crates/thing-core/tests/layout.rs @@ -1227,3 +1227,41 @@ fn overlays_hold_the_bound() { other => panic!("{other:?}"), } } + +#[test] +fn a_px_length_in_cells_is_cells_at_the_cell_metric_per_axis() { + // 8 px across and 16 px down are one cell: a width, margin or border across divides by 8, a + // height or one down by 16, and an item's basis by the axis it runs along. + let mut style = sized(80.0, 32.0); + style.padding = Edges { left: px(8.0), top: px(16.0), right: px(8.0), bottom: px(16.0) }; + let child = bx("child", sized(24.0, 16.0), vec![]); + let root = bx("root", style, vec![child]); + let laid = lay_with(&mut MemState::new(), root, &cells(100.0, 37.0)); + assert_eq!(rect(&laid, "root"), (0.0, 0.0, 10.0, 2.0)); + assert_eq!(rect(&laid, "child"), (1.0, 1.0, 3.0, 1.0)); + + let border = Paint { background: None, border: Some(Border { color: ColorRef::Rgba(Rgba { r: 0, g: 0, b: 0, a: 255 }), width: 16.0 }), radius: 0.0 }; + let framed = bx_paint("framed", sized(80.0, 48.0), border, vec![bx("inner", BoxStyle { grow: 1.0, ..plain() }, vec![])]); + let laid = lay_with(&mut MemState::new(), framed, &cells(100.0, 37.0)); + assert_eq!(rect(&laid, "inner"), (2.0, 1.0, 6.0, 1.0), "a 16 px border is 2 cells across and 1 down"); + + let along = |direction: Direction| { + let style = BoxStyle { direction, ..sized(80.0, 80.0) }; + let item = bx("item", BoxStyle { basis: px(32.0), ..plain() }, vec![]); + let laid = lay_with(&mut MemState::new(), bx("root", style, vec![item]), &cells(100.0, 37.0)); + rect(&laid, "item") + }; + assert_eq!(along(Direction::Row).2, 4.0, "a row's basis runs across: 32 px is 4 cells"); + assert_eq!(along(Direction::Column).3, 2.0, "a column's basis runs down: 32 px is 2 rows"); + + let grid = BoxStyle { + display: Display::Grid, + grid_columns: vec![px(24.0), Dimension::Fr(Scalar { value: 1.0 })], + grid_rows: vec![px(32.0)], + gap: size2(px(16.0), px(16.0)), + ..sized(80.0, 80.0) + }; + let laid = lay_with(&mut MemState::new(), bx("grid", grid, vec![bx("a", plain(), vec![]), bx("b", plain(), vec![])]), &cells(100.0, 37.0)); + assert_eq!((rect(&laid, "a").2, rect(&laid, "a").3), (3.0, 2.0), "tracks: 24 px across, 32 px down"); + assert_eq!(rect(&laid, "b").0, 5.0, "the gap across is 16 px: 2 cells"); +} diff --git a/crates/thing-core/tests/render.rs b/crates/thing-core/tests/render.rs index 758ccb5..396c405 100644 --- a/crates/thing-core/tests/render.rs +++ b/crates/thing-core/tests/render.rs @@ -558,7 +558,7 @@ fn wrapping_text_is_one_command_per_engine_line_at_the_node_origin() { assert_eq!(t.3, 64.0, "layout sized the leaf for the lines the engine returns"); // Cells: the line's characters, one row each. let cells = frame(20.0, 10.0, 1.0, Metrics::Cells); - let root = if let Node::Box(mut b) = root { b.style.size = size2(px(5.0), Dimension::Auto); b.style.padding = edges(px(0.0)); Node::Box(b) } else { unreachable!() }; + let root = if let Node::Box(mut b) = root { b.style.size = size2(px(40.0), Dimension::Auto); b.style.padding = edges(px(0.0)); Node::Box(b) } else { unreachable!() }; let (_, rendered) = inline(root, &cells, &ScrollOffsets::default()); let texts: Vec<(f32, f32, String)> = rendered .commands @@ -1208,7 +1208,7 @@ fn cells_content_keeps_clear_of_every_bordered_controls_border() { // A Button's content likewise, with the label centred between the borders of a tall Button. let button = |height: f64| { let mut style = plain(); - style.size = size2(px(20.0), px(height)); + style.size = size2(px(20.0 * 8.0), px(height * 16.0)); let node = Node::Button(ButtonNode { common: common("b"), content: vec![text("label", "Go")], on_activate: command("dismiss"), enabled: lit_bool(true) }); flat("root", style, vec![node]) }; @@ -1226,3 +1226,17 @@ fn cells_content_keeps_clear_of_every_bordered_controls_border() { let r = rendered(flat("root", plain(), vec![pixels_input])); assert!(matches!(r.commands.last(), Some(RenderCommand::Text { origin, .. }) if origin.0 == 2.0)); } + +#[test] +fn an_image_extent_and_a_px_box_of_the_same_size_are_the_same_cells() { + // One cell is 8x16 device px for both: the Image's pixel extent and a Box's Px size. + let provider = ProviderId::new(PROVIDER); + let mut state = MemState::new(); + state.put(&provider, &catalog(&[("pic", 64, 32)])); + let root = flat("root", plain(), vec![image("pic", "pic", ImageFit::Fill), flat("twin", sized(64.0, 32.0), vec![])]); + let tree = bind(&mut state, &surface_of(root)).expect("resolves"); + let frame = frame(30.0, 12.0, 1.0, Metrics::Cells); + let (_, rendered) = draw_with(Engine::Real, &tree, &frame, &ScrollOffsets::default()); + assert_eq!(xywh(placed(&rendered, "pic")), (0.0, 0.0, 8.0, 2.0)); + assert_eq!(xywh(placed(&rendered, "twin")), (8.0, 0.0, 8.0, 2.0)); +} diff --git a/crates/thing-tui/tests/goldens/screen-f01-swarm-dashboard-cells.txt b/crates/thing-tui/tests/goldens/screen-f01-swarm-dashboard-cells.txt index 260c4a8..2465ff8 100644 --- a/crates/thing-tui/tests/goldens/screen-f01-swarm-dashboard-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f01-swarm-dashboard-cells.txt @@ -1,25 +1,8 @@ surface thing:surface:provider.swarm.dashboard 100x37 +42.0% Eureka - - 42.0% Eureka - - - - - - - - - Libby Kiko - - - - - - - - - [Restart ] +Libby Kiko +[Restart ] @@ -36,42 +19,56 @@ surface thing:surface:provider.swarm.dashboard 100x37 -style 0 0 100 - #1e1e2e - + + + + + + + + + + + + + + + + + +style 0 0 5 #ffffff #1e1e2e - +style 0 5 46 - #1e1e2e - +style 0 51 6 #eeeef4 #1e1e2e - +style 0 57 43 - #1e1e2e - style 1 0 100 - #1e1e2e - -style 2 0 2 - #1e1e2e - -style 2 2 5 #ffffff #1e1e2e - -style 2 7 47 - #1e1e2e - -style 2 54 6 #eeeef4 #1e1e2e - -style 2 60 40 - #1e1e2e - -style 3 0 100 - #1e1e2e - -style 4 0 100 - #1e1e2e - -style 5 0 100 - #1e1e2e - -style 6 0 100 - #1e1e2e - -style 7 0 100 - #1e1e2e - -style 8 0 100 - #1e1e2e - -style 9 0 100 - #1e1e2e - -style 10 0 100 - #1e1e2e - -style 11 0 2 - #1e1e2e - -style 11 2 5 #eeeef4 #1e1e2e - -style 11 7 47 - #1e1e2e - -style 11 54 4 #eeeef4 #1e1e2e - -style 11 58 42 - #1e1e2e - -style 12 0 100 - #1e1e2e - -style 13 0 100 - #1e1e2e - -style 14 0 100 - #1e1e2e - -style 15 0 100 - #1e1e2e - -style 16 0 100 - #1e1e2e - -style 17 0 100 - #1e1e2e - -style 18 0 100 - #1e1e2e - -style 19 0 100 - #1e1e2e - -style 20 0 2 - #1e1e2e - -style 20 2 1 #4a4a60 #2c2c3e - -style 20 3 7 #eeeef4 #2c2c3e - -style 20 10 39 - #2c2c3e - -style 20 49 1 #4a4a60 #2c2c3e - -style 20 50 50 - #1e1e2e - -style 21 0 100 - #1e1e2e - -style 22 0 100 - #1e1e2e - +style 2 0 5 #eeeef4 #1e1e2e - +style 2 5 46 - #1e1e2e - +style 2 51 4 #eeeef4 #1e1e2e - +style 2 55 45 - #1e1e2e - +style 3 0 1 #4a4a60 #2c2c3e - +style 3 1 7 #eeeef4 #2c2c3e - +style 3 8 41 - #2c2c3e - +style 3 49 1 #4a4a60 #2c2c3e - +style 3 50 50 - #1e1e2e - +style 4 0 100 - - - +style 5 0 100 - - - +style 6 0 100 - - - +style 7 0 100 - - - +style 8 0 100 - - - +style 9 0 100 - - - +style 10 0 100 - - - +style 11 0 100 - - - +style 12 0 100 - - - +style 13 0 100 - - - +style 14 0 100 - - - +style 15 0 100 - - - +style 16 0 100 - - - +style 17 0 100 - - - +style 18 0 100 - - - +style 19 0 100 - - - +style 20 0 100 - - - +style 21 0 100 - - - +style 22 0 100 - - - style 23 0 100 - - - style 24 0 100 - - - style 25 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f02-login-effect-cells.txt b/crates/thing-tui/tests/goldens/screen-f02-login-effect-cells.txt index 0747580..5e9e394 100644 --- a/crates/thing-tui/tests/goldens/screen-f02-login-effect-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f02-login-effect-cells.txt @@ -1,16 +1,7 @@ surface thing:surface:provider.login.login 100x37 +[username ] - - [username ] - - - - - - - - - [Sign in ] +[Sign in ] @@ -36,14 +27,24 @@ surface thing:surface:provider.login.login 100x37 -style 0 0 100 - - - + + + + + + + + + +style 0 0 1 #4a4a60 - - +style 0 1 8 #6e6e80 - - +style 0 9 90 - - - +style 0 99 1 #4a4a60 - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 1 #4a4a60 - - -style 2 3 8 #6e6e80 - - -style 2 11 86 - - - -style 2 97 1 #4a4a60 - - -style 2 98 2 - - - +style 2 0 1 #4a4a60 #2c2c3e - +style 2 1 7 #eeeef4 #2c2c3e - +style 2 8 91 - #2c2c3e - +style 2 99 1 #4a4a60 #2c2c3e - style 3 0 100 - - - style 4 0 100 - - - style 5 0 100 - - - @@ -52,12 +53,7 @@ style 7 0 100 - - - style 8 0 100 - - - style 9 0 100 - - - style 10 0 100 - - - -style 11 0 2 - - - -style 11 2 1 #4a4a60 #2c2c3e - -style 11 3 7 #eeeef4 #2c2c3e - -style 11 10 87 - #2c2c3e - -style 11 97 1 #4a4a60 #2c2c3e - -style 11 98 2 - - - +style 11 0 100 - - - style 12 0 100 - - - style 13 0 100 - - - style 14 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f03-input-target-cells.txt b/crates/thing-tui/tests/goldens/screen-f03-input-target-cells.txt index 68d5f36..d8591de 100644 --- a/crates/thing-tui/tests/goldens/screen-f03-input-target-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f03-input-target-cells.txt @@ -1,15 +1,13 @@ surface thing:surface:provider.muninn.input-target 100x37 - - The board the target sits on░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - ░░░░░░░░░░░░Ready░░░░░░░░░░░░░░░░░░░░░░░ - ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + ░░░░░Ready░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ @@ -36,6 +34,8 @@ surface thing:surface:provider.muninn.input-target 100x37 + + style 0 0 100 - - - style 1 0 100 - - - style 2 0 100 - - - @@ -44,9 +44,9 @@ style 4 0 100 - - - style 5 0 100 - - - style 6 0 100 - - - style 7 0 100 - - - -style 8 0 42 - - - -style 8 42 5 #eeeef4 - - -style 8 47 53 - - - +style 8 0 35 - - - +style 8 35 5 #eeeef4 - - +style 8 40 60 - - - style 9 0 100 - - - style 10 0 100 - - - style 11 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f04-form-cells.txt b/crates/thing-tui/tests/goldens/screen-f04-form-cells.txt index 85e7f18..a7b13f3 100644 --- a/crates/thing-tui/tests/goldens/screen-f04-form-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f04-form-cells.txt @@ -1,7 +1,10 @@ surface thing:surface:provider.settings.form 100x37 +[ ] - [ ] +[Dark ] + +[8080 ] @@ -19,7 +22,6 @@ surface thing:surface:provider.settings.form 100x37 - [Dark ] @@ -28,34 +30,34 @@ surface thing:surface:provider.settings.form 100x37 - [8080 ] - -style 0 0 100 - - - +style 0 0 1 #4a4a60 - - +style 0 1 97 - - - +style 0 98 1 - #7c9cff - +style 0 99 1 #4a4a60 - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 1 #4a4a60 - - -style 2 3 93 - - - -style 2 96 1 - #7c9cff - -style 2 97 1 #4a4a60 - - -style 2 98 2 - - - -style 3 0 100 - - - +style 2 0 99 - #4a4a60 - +style 2 99 1 - #7c9cff - +style 3 0 1 #4a4a60 - - +style 3 1 4 #eeeef4 - - +style 3 5 94 - - - +style 3 99 1 #4a4a60 - - style 4 0 100 - - - -style 5 0 100 - - - +style 5 0 1 #4a4a60 - - +style 5 1 4 #eeeef4 - - +style 5 5 94 - - - +style 5 99 1 #4a4a60 - - style 6 0 100 - - - style 7 0 100 - - - style 8 0 100 - - - style 9 0 100 - - - style 10 0 100 - - - -style 11 0 2 - - - -style 11 2 95 - #4a4a60 - -style 11 97 1 - #7c9cff - -style 11 98 2 - - - +style 11 0 100 - - - style 12 0 100 - - - style 13 0 100 - - - style 14 0 100 - - - @@ -64,12 +66,7 @@ style 16 0 100 - - - style 17 0 100 - - - style 18 0 100 - - - style 19 0 100 - - - -style 20 0 2 - - - -style 20 2 1 #4a4a60 - - -style 20 3 4 #eeeef4 - - -style 20 7 90 - - - -style 20 97 1 #4a4a60 - - -style 20 98 2 - - - +style 20 0 100 - - - style 21 0 100 - - - style 22 0 100 - - - style 23 0 100 - - - @@ -78,12 +75,7 @@ style 25 0 100 - - - style 26 0 100 - - - style 27 0 100 - - - style 28 0 100 - - - -style 29 0 2 - - - -style 29 2 1 #4a4a60 - - -style 29 3 4 #eeeef4 - - -style 29 7 90 - - - -style 29 97 1 #4a4a60 - - -style 29 98 2 - - - +style 29 0 100 - - - style 30 0 100 - - - style 31 0 100 - - - style 32 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f05-modal-overlay-cells.txt b/crates/thing-tui/tests/goldens/screen-f05-modal-overlay-cells.txt index d7db5d2..4c5a226 100644 --- a/crates/thing-tui/tests/goldens/screen-f05-modal-overlay-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f05-modal-overlay-cells.txt @@ -1,32 +1,5 @@ surface thing:surface:provider.dialog.modal 100x37 - - - The archive holds 12 items. - - - - - - - Delete the archive? - - - - - - - - - [Delete ] - - - - - - - - - [Cancel ] +The archive holds 12 items. @@ -36,50 +9,71 @@ surface thing:surface:provider.dialog.modal 100x37 -style 0 0 100 - #000000 - + + + + + + + +Delete the archive? +[Delete ] + +[Cancel ] + + + + + + + + + + + + + + + + +style 0 0 27 #eeeef4 #000000 - +style 0 27 73 - #000000 - style 1 0 100 - #000000 - -style 2 0 2 - #000000 - -style 2 2 27 #eeeef4 #000000 - -style 2 29 71 - #000000 - +style 2 0 100 - #000000 - style 3 0 100 - #000000 - style 4 0 100 - #000000 - style 5 0 100 - #000000 - style 6 0 100 - #000000 - -style 7 0 100 - #2c2c3e - -style 8 0 100 - #2c2c3e - -style 9 0 2 - #2c2c3e - -style 9 2 19 #eeeef4 #2c2c3e - -style 9 21 79 - #2c2c3e - -style 10 0 100 - #2c2c3e - -style 11 0 100 - #2c2c3e - -style 12 0 100 - #2c2c3e - -style 13 0 100 - #2c2c3e - -style 14 0 100 - #2c2c3e - -style 15 0 100 - #2c2c3e - +style 7 0 100 - #000000 - +style 8 0 100 - #000000 - +style 9 0 100 - #000000 - +style 10 0 100 - #000000 - +style 11 0 100 - #000000 - +style 12 0 100 - #000000 - +style 13 0 100 - #000000 - +style 14 0 100 - #000000 - +style 15 0 100 - #000000 - style 16 0 100 - #2c2c3e - -style 17 0 100 - #2c2c3e - -style 18 0 2 - #2c2c3e - -style 18 2 1 #4a4a60 #2c2c3e - -style 18 3 6 #eeeef4 #2c2c3e - -style 18 9 88 - #2c2c3e - -style 18 97 1 #4a4a60 #2c2c3e - -style 18 98 2 - #2c2c3e - +style 17 0 19 #eeeef4 #2c2c3e - +style 17 19 81 - #2c2c3e - +style 18 0 1 #4a4a60 #2c2c3e - +style 18 1 6 #eeeef4 #2c2c3e - +style 18 7 92 - #2c2c3e - +style 18 99 1 #4a4a60 #2c2c3e - style 19 0 100 - #2c2c3e - -style 20 0 100 - #2c2c3e - -style 21 0 100 - #2c2c3e - -style 22 0 100 - #2c2c3e - -style 23 0 100 - #2c2c3e - -style 24 0 100 - #2c2c3e - -style 25 0 100 - #2c2c3e - -style 26 0 100 - #2c2c3e - -style 27 0 2 - #2c2c3e - -style 27 2 1 #4a4a60 #2c2c3e - -style 27 3 6 #eeeef4 #2c2c3e - -style 27 9 88 - #2c2c3e - -style 27 97 1 #4a4a60 #2c2c3e - -style 27 98 2 - #2c2c3e - -style 28 0 100 - #2c2c3e - -style 29 0 100 - #2c2c3e - +style 20 0 1 #4a4a60 #2c2c3e - +style 20 1 6 #eeeef4 #2c2c3e - +style 20 7 92 - #2c2c3e - +style 20 99 1 #4a4a60 #2c2c3e - +style 21 0 100 - #000000 - +style 22 0 100 - #000000 - +style 23 0 100 - #000000 - +style 24 0 100 - #000000 - +style 25 0 100 - #000000 - +style 26 0 100 - #000000 - +style 27 0 100 - #000000 - +style 28 0 100 - #000000 - +style 29 0 100 - #000000 - style 30 0 100 - #000000 - style 31 0 100 - #000000 - style 32 0 100 - #000000 - diff --git a/crates/thing-tui/tests/goldens/screen-f06-scroll-list-cells.txt b/crates/thing-tui/tests/goldens/screen-f06-scroll-list-cells.txt index 2de2bdd..4f6aaa4 100644 --- a/crates/thing-tui/tests/goldens/screen-f06-scroll-list-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f06-scroll-list-cells.txt @@ -1,9 +1,28 @@ surface thing:surface:provider.feed.scroll-list 100x37 + Item 0 + Item 1 + Item 2 + Item 3 + Item 4 - Item 0 + Item 5 + + Item 6 + + Item 7 + Item 8 + + Item 9 + + Item 10 + + Item 11 + Item 12 + + Item 13 @@ -16,75 +35,66 @@ surface thing:surface:provider.feed.scroll-list 100x37 - Item 1 - - - - - - - - - - - - Item 2 - - - - - - -style 0 0 99 - - - -style 0 99 1 - #666666 - -style 1 0 99 - - - -style 1 99 1 - #666666 - -style 2 0 99 - - - -style 2 99 1 - #666666 - -style 3 0 99 - - - -style 3 99 1 - #666666 - -style 4 0 4 - - - -style 4 4 6 #eeeef4 - - -style 4 10 89 - - - -style 4 99 1 - #666666 - -style 5 0 99 - - - -style 5 99 1 - #666666 - -style 6 0 99 - - - -style 6 99 1 - #666666 - -style 7 0 99 - - - -style 7 99 1 - #666666 - -style 8 0 99 - - - -style 8 99 1 - #666666 - -style 9 0 99 - - - -style 9 99 1 - #666666 - -style 10 0 99 - - - -style 10 99 1 - #666666 - -style 11 0 99 - - - -style 11 99 1 - #666666 - +style 0 0 1 - - - +style 0 1 6 #eeeef4 - - +style 0 7 93 - - - +style 1 0 100 - - - +style 2 0 1 - - - +style 2 1 6 #eeeef4 - - +style 2 7 93 - - - +style 3 0 100 - - - +style 4 0 1 - - - +style 4 1 6 #eeeef4 - - +style 4 7 93 - - - +style 5 0 100 - - - +style 6 0 1 - - - +style 6 1 6 #eeeef4 - - +style 6 7 93 - - - +style 7 0 1 - - - +style 7 1 6 #eeeef4 - - +style 7 7 93 - - - +style 8 0 100 - - - +style 9 0 1 - - - +style 9 1 6 #eeeef4 - - +style 9 7 93 - - - +style 10 0 100 - - - +style 11 0 1 - - - +style 11 1 6 #eeeef4 - - +style 11 7 93 - - - style 12 0 100 - - - -style 13 0 100 - - - -style 14 0 100 - - - +style 13 0 1 - - - +style 13 1 6 #eeeef4 - - +style 13 7 93 - - - +style 14 0 1 - - - +style 14 1 6 #eeeef4 - - +style 14 7 93 - - - style 15 0 100 - - - -style 16 0 100 - - - -style 17 0 4 - - - -style 17 4 6 #eeeef4 - - -style 17 10 90 - - - -style 18 0 100 - - - +style 16 0 1 - - - +style 16 1 6 #eeeef4 - - +style 16 7 93 - - - +style 17 0 100 - - - +style 18 0 1 - - - +style 18 1 7 #eeeef4 - - +style 18 8 92 - - - style 19 0 100 - - - -style 20 0 100 - - - -style 21 0 100 - - - +style 20 0 1 - - - +style 20 1 7 #eeeef4 - - +style 20 8 92 - - - +style 21 0 1 - - - +style 21 1 7 #eeeef4 - - +style 21 8 92 - - - style 22 0 100 - - - -style 23 0 100 - - - +style 23 0 1 - - - +style 23 1 7 #eeeef4 - - +style 23 8 92 - - - style 24 0 100 - - - style 25 0 100 - - - style 26 0 100 - - - style 27 0 100 - - - style 28 0 100 - - - style 29 0 100 - - - -style 30 0 4 - - - -style 30 4 6 #eeeef4 - - -style 30 10 90 - - - +style 30 0 100 - - - style 31 0 100 - - - style 32 0 100 - - - style 33 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f07-plot-cells.txt b/crates/thing-tui/tests/goldens/screen-f07-plot-cells.txt index 0aefa99..63a6f2e 100644 --- a/crates/thing-tui/tests/goldens/screen-f07-plot-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f07-plot-cells.txt @@ -1,16 +1,14 @@ surface thing:surface:provider.market.plot 100x37 - - - ⢀⠎⠒⢄⡀ - ⢠⠃ ⠈⠑⠤⡀ - ⡰⠁ ⠈⠑⠢⣀ - ⡜ - ⢀⠎ - ⡠⠊⠒⠤⣀ ⡠⠃ - ⡠⠊ ⠉⠒⠤⣀ ⡰⠁ - ⢀⠎ ⠉⠒⠜ - ⢀⠔⠁ + ⢀⠎⠒⢄⡀ + ⢠⠃ ⠈⠑⠤⡀ + ⡰⠁ ⠈⠑⠢⣀ + ⡜ + ⢀⠎ + ⡠⠊⠒⠤⣀ ⡠⠃ + ⡠⠊ ⠉⠒⠤⣀ ⡰⠁ + ⢀⠎ ⠉⠒⠜ ⢀⠔⠁ +⢀⠔⠁ @@ -36,92 +34,94 @@ surface thing:surface:provider.market.plot 100x37 -style 0 0 100 - - - -style 1 0 100 - - - -style 2 0 29 - - - -style 2 29 5 #7c9cff - - -style 2 34 66 - - - -style 3 0 28 - - - -style 3 28 2 #7c9cff - - -style 3 30 3 - - - -style 3 33 4 #7c9cff - - -style 3 37 63 - - - -style 4 0 27 - - - -style 4 27 2 #7c9cff - - -style 4 29 7 - - - -style 4 36 4 #7c9cff - - -style 4 40 60 - - - -style 5 0 26 - - - -style 5 26 1 #7c9cff - - -style 5 27 73 - - - -style 6 0 24 - - - -style 6 24 2 #7c9cff - - -style 6 26 74 - - - -style 7 0 10 - - - -style 7 10 5 #7c9cff - - -style 7 15 8 - - - -style 7 23 2 #7c9cff - - -style 7 25 75 - - - -style 8 0 8 - - - -style 8 8 2 #7c9cff - - -style 8 10 5 - - - -style 8 15 4 #7c9cff - - -style 8 19 3 - - - -style 8 22 2 #7c9cff - - -style 8 24 76 - - - -style 9 0 6 - - - -style 9 6 2 #7c9cff - - -style 9 8 11 - - - -style 9 19 3 #7c9cff - - -style 9 22 78 - - - -style 10 0 4 - - - -style 10 4 3 #7c9cff - - -style 10 7 93 - - - -style 11 0 2 - - - -style 11 2 3 #7c9cff - - -style 11 5 95 - - - -style 12 0 100 - - - -style 13 0 100 - - - -style 14 0 100 - - - -style 15 0 100 - - - -style 16 0 100 - - - -style 17 0 100 - - - -style 18 0 100 - - - -style 19 0 100 - - - -style 20 0 25 - - - -style 20 25 7 - #7c9cff - -style 20 32 68 - - - -style 21 0 25 - - - -style 21 25 7 - #7c9cff - -style 21 32 68 - - - -style 22 0 25 - - - -style 22 25 15 - #7c9cff - -style 22 40 60 - - - -style 23 0 10 - - - -style 23 10 7 - #7c9cff - -style 23 17 8 - - - -style 23 25 15 - #7c9cff - -style 23 40 60 - - - -style 24 0 10 - - - -style 24 10 7 - #7c9cff - -style 24 17 8 - - - -style 24 25 15 - #7c9cff - -style 24 40 60 - - - -style 25 0 10 - - - -style 25 10 30 - #7c9cff - -style 25 40 60 - - - -style 26 0 2 - - - -style 26 2 38 - #7c9cff - -style 26 40 60 - - - -style 27 0 2 - - - -style 27 2 38 - #7c9cff - -style 27 40 60 - - - -style 28 0 2 - - - -style 28 2 38 - #7c9cff - -style 28 40 60 - - - -style 29 0 2 - - - -style 29 2 38 - #7c9cff - -style 29 40 60 - - - + + +style 0 0 27 - - - +style 0 27 5 #7c9cff - - +style 0 32 68 - - - +style 1 0 26 - - - +style 1 26 2 #7c9cff - - +style 1 28 3 - - - +style 1 31 4 #7c9cff - - +style 1 35 65 - - - +style 2 0 25 - - - +style 2 25 2 #7c9cff - - +style 2 27 7 - - - +style 2 34 4 #7c9cff - - +style 2 38 62 - - - +style 3 0 24 - - - +style 3 24 1 #7c9cff - - +style 3 25 75 - - - +style 4 0 22 - - - +style 4 22 2 #7c9cff - - +style 4 24 76 - - - +style 5 0 8 - - - +style 5 8 5 #7c9cff - - +style 5 13 8 - - - +style 5 21 2 #7c9cff - - +style 5 23 77 - - - +style 6 0 6 - - - +style 6 6 2 #7c9cff - - +style 6 8 5 - - - +style 6 13 4 #7c9cff - - +style 6 17 3 - - - +style 6 20 2 #7c9cff - - +style 6 22 78 - - - +style 7 0 4 - - - +style 7 4 2 #7c9cff - - +style 7 6 11 - - - +style 7 17 3 #7c9cff - - +style 7 20 80 - - - +style 8 0 2 - - - +style 8 2 3 #7c9cff - - +style 8 5 95 - - - +style 9 0 3 #7c9cff - - +style 9 3 97 - - - +style 10 0 100 - - - +style 11 0 23 - - - +style 11 23 7 - #7c9cff - +style 11 30 70 - - - +style 12 0 23 - - - +style 12 23 7 - #7c9cff - +style 12 30 70 - - - +style 13 0 23 - - - +style 13 23 15 - #7c9cff - +style 13 38 62 - - - +style 14 0 8 - - - +style 14 8 7 - #7c9cff - +style 14 15 8 - - - +style 14 23 15 - #7c9cff - +style 14 38 62 - - - +style 15 0 8 - - - +style 15 8 7 - #7c9cff - +style 15 15 8 - - - +style 15 23 15 - #7c9cff - +style 15 38 62 - - - +style 16 0 8 - - - +style 16 8 30 - #7c9cff - +style 16 38 62 - - - +style 17 0 38 - #7c9cff - +style 17 38 62 - - - +style 18 0 38 - #7c9cff - +style 18 38 62 - - - +style 19 0 38 - #7c9cff - +style 19 38 62 - - - +style 20 0 38 - #7c9cff - +style 20 38 62 - - - +style 21 0 2 - #7c9cff - +style 21 2 98 - - - +style 22 0 2 - #7c9cff - +style 22 2 98 - - - +style 23 0 2 - #7c9cff - +style 23 2 98 - - - +style 24 0 2 - #7c9cff - +style 24 2 98 - - - +style 25 0 2 - #7c9cff - +style 25 2 98 - - - +style 26 0 100 - - - +style 27 0 100 - - - +style 28 0 100 - - - +style 29 0 100 - - - style 30 0 100 - - - style 31 0 100 - - - style 32 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f08-embed-viewport-cells.txt b/crates/thing-tui/tests/goldens/screen-f08-embed-viewport-cells.txt index f9aac58..7041ff3 100644 --- a/crates/thing-tui/tests/goldens/screen-f08-embed-viewport-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f08-embed-viewport-cells.txt @@ -1,7 +1,5 @@ surface thing:surface:provider.viewport.embed-viewport 100x37 - - - before after +before after @@ -36,13 +34,13 @@ surface thing:surface:provider.viewport.embed-viewport 100x37 -style 0 0 100 - - - + + +style 0 0 6 #eeeef4 - - +style 0 6 89 - - - +style 0 95 5 #eeeef4 - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 6 #eeeef4 - - -style 2 8 85 - - - -style 2 93 5 #eeeef4 - - -style 2 98 2 - - - +style 2 0 100 - - - style 3 0 100 - - - style 4 0 100 - - - style 5 0 100 - - - @@ -77,4 +75,4 @@ style 33 0 100 - - - style 34 0 100 - - - style 35 0 100 - - - style 36 0 100 - - - -embed 31 2 40 10 "viewport.world" "main" +embed 31 0 40 11 "viewport.world" "main" diff --git a/crates/thing-tui/tests/goldens/screen-f09-composition-stack-cells.txt b/crates/thing-tui/tests/goldens/screen-f09-composition-stack-cells.txt index efeeff3..35349dd 100644 --- a/crates/thing-tui/tests/goldens/screen-f09-composition-stack-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f09-composition-stack-cells.txt @@ -1,7 +1,14 @@ surface thing:surface:provider.stack.stack 100x37 +Load - Load + Card + + [Open ] + Card + + [Open ] + nested @@ -17,16 +24,6 @@ surface thing:surface:provider.stack.stack 100x37 - Card - - - - - - - - - [Open ] @@ -36,18 +33,35 @@ surface thing:surface:provider.stack.stack 100x37 -style 0 0 100 - - - + + + +style 0 0 4 #ff00ff - - +style 0 4 96 - - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 4 #ff00ff - - -style 2 6 94 - - - -style 3 0 100 - - - +style 2 0 100 - - - +style 3 0 1 - - - +style 3 1 4 #ffffff - - +style 3 5 95 - - - style 4 0 100 - - - -style 5 0 100 - - - -style 6 0 100 - - - +style 5 0 1 - - - +style 5 1 1 #4a4a60 #2c2c3e - +style 5 2 4 #eeeef4 #2c2c3e - +style 5 6 93 - #2c2c3e - +style 5 99 1 #4a4a60 #2c2c3e - +style 6 0 1 - - - +style 6 1 4 #ffffff - - +style 6 5 95 - - - style 7 0 100 - - - -style 8 0 100 - - - -style 9 0 100 - - - +style 8 0 1 - - - +style 8 1 1 #4a4a60 #2c2c3e - +style 8 2 4 #eeeef4 #2c2c3e - +style 8 6 92 - #2c2c3e - +style 8 98 1 #4a4a60 #2c2c3e - +style 8 99 1 - - - +style 9 0 1 - - - +style 9 1 6 #eeeef4 - - +style 9 7 93 - - - style 10 0 100 - - - style 11 0 100 - - - style 12 0 100 - - - @@ -56,9 +70,7 @@ style 14 0 100 - - - style 15 0 100 - - - style 16 0 100 - - - style 17 0 100 - - - -style 18 0 4 - - - -style 18 4 4 #ffffff - - -style 18 8 92 - - - +style 18 0 100 - - - style 19 0 100 - - - style 20 0 100 - - - style 21 0 100 - - - @@ -67,12 +79,7 @@ style 23 0 100 - - - style 24 0 100 - - - style 25 0 100 - - - style 26 0 100 - - - -style 27 0 4 - - - -style 27 4 1 #4a4a60 #2c2c3e - -style 27 5 4 #eeeef4 #2c2c3e - -style 27 9 86 - #2c2c3e - -style 27 95 1 #4a4a60 #2c2c3e - -style 27 96 4 - - - +style 27 0 100 - - - style 28 0 100 - - - style 29 0 100 - - - style 30 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f10-hostile-cells.txt b/crates/thing-tui/tests/goldens/screen-f10-hostile-cells.txt index ea523f7..620f366 100644 --- a/crates/thing-tui/tests/goldens/screen-f10-hostile-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f10-hostile-cells.txt @@ -1,8 +1,6 @@ surface thing:surface:provider.hostile.duplicate-id refused DuplicateNodeId surface thing:surface:provider.hostile.schema-mismatch 100x37 - - - [ ] +[ ] @@ -37,13 +35,13 @@ surface thing:surface:provider.hostile.schema-mismatch 100x37 -style 0 0 100 - - - + + +style 0 0 1 #e5484d - - +style 0 1 98 - - - +style 0 99 1 #e5484d - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 1 #e5484d - - -style 2 3 94 - - - -style 2 97 1 #e5484d - - -style 2 98 2 - - - +style 2 0 100 - - - style 3 0 100 - - - style 4 0 100 - - - style 5 0 100 - - - @@ -80,9 +78,7 @@ style 35 0 100 - - - style 36 0 100 - - - surface thing:surface:provider.hostile.undeclared-command refused UndeclaredCommand surface thing:surface:provider.hostile.unresolved-use 100x37 - - - [ ] +[ ] @@ -117,13 +113,13 @@ surface thing:surface:provider.hostile.unresolved-use 100x37 -style 0 0 100 - - - + + +style 0 0 1 #e5484d #6e6e80 - +style 0 1 98 - #6e6e80 - +style 0 99 1 #e5484d #6e6e80 - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 1 #e5484d #6e6e80 - -style 2 3 94 - #6e6e80 - -style 2 97 1 #e5484d #6e6e80 - -style 2 98 2 - - - +style 2 0 100 - - - style 3 0 100 - - - style 4 0 100 - - - style 5 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f11-deep-cells.txt b/crates/thing-tui/tests/goldens/screen-f11-deep-cells.txt index 31fbf9b..5e4762c 100644 --- a/crates/thing-tui/tests/goldens/screen-f11-deep-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f11-deep-cells.txt @@ -1,963 +1,75 @@ surface thing:surface:provider.deep.deep 100x37 -┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ -│ │ -│ │ -│ ┌────────────────────────────────────────────────────────────────────────────────────────────┐ │ -│ │ │ │ -│ │ │ │ -│ │ ┌──────────────────────────────────────────────────────────────────────────────────────┐ │ │ -│ │ │ │ │ │ -│ │ │ │ │ │ -│ │ │ ┌────────────────────────────────────────────────────────────────────────────────┐ │ │ │ -│ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ -│ │ │ │ ┌──────────────────────────────────────────────────────────────────────────┐ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ ┌────────────────────────────────────────────────────────────────────┐ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ ┌────────────────────────────────────────────────────────┐ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ ┌────────────────────────────────────────────┐ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ ┌──────────────────────────────────────┐ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ ┌────────────────────────────────┐ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -│ │ │ │ │ │ │ │ │ │ │ │ ┌──────────────────────────┐ │ │ │ │ │ │ │ │ │ │ │ │ -style 0 0 100 #50a0ff - - -style 1 0 1 #50a0ff - - -style 1 1 98 - - - -style 1 99 1 #50a0ff - - -style 2 0 1 #50a0ff - - -style 2 1 98 - - - -style 2 99 1 #50a0ff - - -style 3 0 1 #50a0ff - - -style 3 1 2 - - - -style 3 3 94 #5ca0f3 - - -style 3 97 2 - - - -style 3 99 1 #50a0ff - - -style 4 0 1 #50a0ff - - -style 4 1 2 - - - -style 4 3 1 #5ca0f3 - - -style 4 4 92 - - - -style 4 96 1 #5ca0f3 - - -style 4 97 2 - - - -style 4 99 1 #50a0ff - - -style 5 0 1 #50a0ff - - -style 5 1 2 - - - -style 5 3 1 #5ca0f3 - - -style 5 4 92 - - - -style 5 96 1 #5ca0f3 - - -style 5 97 2 - - - -style 5 99 1 #50a0ff - - -style 6 0 1 #50a0ff - - -style 6 1 2 - - - -style 6 3 1 #5ca0f3 - - -style 6 4 2 - - - -style 6 6 88 #68a0e7 - - -style 6 94 2 - - - -style 6 96 1 #5ca0f3 - - -style 6 97 2 - - - -style 6 99 1 #50a0ff - - -style 7 0 1 #50a0ff - - -style 7 1 2 - - - -style 7 3 1 #5ca0f3 - - -style 7 4 2 - - - -style 7 6 1 #68a0e7 - - -style 7 7 86 - - - -style 7 93 1 #68a0e7 - - -style 7 94 2 - - - -style 7 96 1 #5ca0f3 - - -style 7 97 2 - - - -style 7 99 1 #50a0ff - - -style 8 0 1 #50a0ff - - -style 8 1 2 - - - -style 8 3 1 #5ca0f3 - - -style 8 4 2 - - - -style 8 6 1 #68a0e7 - - -style 8 7 86 - - - -style 8 93 1 #68a0e7 - - -style 8 94 2 - - - -style 8 96 1 #5ca0f3 - - -style 8 97 2 - - - -style 8 99 1 #50a0ff - - -style 9 0 1 #50a0ff - - -style 9 1 2 - - - -style 9 3 1 #5ca0f3 - - -style 9 4 2 - - - -style 9 6 1 #68a0e7 - - -style 9 7 2 - - - -style 9 9 82 #74a0db - - -style 9 91 2 - - - -style 9 93 1 #68a0e7 - - -style 9 94 2 - - - -style 9 96 1 #5ca0f3 - - -style 9 97 2 - - - -style 9 99 1 #50a0ff - - -style 10 0 1 #50a0ff - - -style 10 1 2 - - - -style 10 3 1 #5ca0f3 - - -style 10 4 2 - - - -style 10 6 1 #68a0e7 - - -style 10 7 2 - - - -style 10 9 1 #74a0db - - -style 10 10 80 - - - -style 10 90 1 #74a0db - - -style 10 91 2 - - - -style 10 93 1 #68a0e7 - - -style 10 94 2 - - - -style 10 96 1 #5ca0f3 - - -style 10 97 2 - - - -style 10 99 1 #50a0ff - - -style 11 0 1 #50a0ff - - -style 11 1 2 - - - -style 11 3 1 #5ca0f3 - - -style 11 4 2 - - - -style 11 6 1 #68a0e7 - - -style 11 7 2 - - - -style 11 9 1 #74a0db - - -style 11 10 80 - - - -style 11 90 1 #74a0db - - -style 11 91 2 - - - -style 11 93 1 #68a0e7 - - -style 11 94 2 - - - -style 11 96 1 #5ca0f3 - - -style 11 97 2 - - - -style 11 99 1 #50a0ff - - -style 12 0 1 #50a0ff - - -style 12 1 2 - - - -style 12 3 1 #5ca0f3 - - -style 12 4 2 - - - -style 12 6 1 #68a0e7 - - -style 12 7 2 - - - -style 12 9 1 #74a0db - - -style 12 10 2 - - - -style 12 12 76 #80a0cf - - -style 12 88 2 - - - -style 12 90 1 #74a0db - - -style 12 91 2 - - - -style 12 93 1 #68a0e7 - - -style 12 94 2 - - - -style 12 96 1 #5ca0f3 - - -style 12 97 2 - - - -style 12 99 1 #50a0ff - - -style 13 0 1 #50a0ff - - -style 13 1 2 - - - -style 13 3 1 #5ca0f3 - - -style 13 4 2 - - - -style 13 6 1 #68a0e7 - - -style 13 7 2 - - - -style 13 9 1 #74a0db - - -style 13 10 2 - - - -style 13 12 1 #80a0cf - - -style 13 13 74 - - - -style 13 87 1 #80a0cf - - -style 13 88 2 - - - -style 13 90 1 #74a0db - - -style 13 91 2 - - - -style 13 93 1 #68a0e7 - - -style 13 94 2 - - - -style 13 96 1 #5ca0f3 - - -style 13 97 2 - - - -style 13 99 1 #50a0ff - - -style 14 0 1 #50a0ff - - -style 14 1 2 - - - -style 14 3 1 #5ca0f3 - - -style 14 4 2 - - - -style 14 6 1 #68a0e7 - - -style 14 7 2 - - - -style 14 9 1 #74a0db - - -style 14 10 2 - - - -style 14 12 1 #80a0cf - - -style 14 13 74 - - - -style 14 87 1 #80a0cf - - -style 14 88 2 - - - -style 14 90 1 #74a0db - - -style 14 91 2 - - - -style 14 93 1 #68a0e7 - - -style 14 94 2 - - - -style 14 96 1 #5ca0f3 - - -style 14 97 2 - - - -style 14 99 1 #50a0ff - - -style 15 0 1 #50a0ff - - -style 15 1 2 - - - -style 15 3 1 #5ca0f3 - - -style 15 4 2 - - - -style 15 6 1 #68a0e7 - - -style 15 7 2 - - - -style 15 9 1 #74a0db - - -style 15 10 2 - - - -style 15 12 1 #80a0cf - - -style 15 13 2 - - - -style 15 15 70 #8ca0c3 - - -style 15 85 2 - - - -style 15 87 1 #80a0cf - - -style 15 88 2 - - - -style 15 90 1 #74a0db - - -style 15 91 2 - - - -style 15 93 1 #68a0e7 - - -style 15 94 2 - - - -style 15 96 1 #5ca0f3 - - -style 15 97 2 - - - -style 15 99 1 #50a0ff - - -style 16 0 1 #50a0ff - - -style 16 1 2 - - - -style 16 3 1 #5ca0f3 - - -style 16 4 2 - - - -style 16 6 1 #68a0e7 - - -style 16 7 2 - - - -style 16 9 1 #74a0db - - -style 16 10 2 - - - -style 16 12 1 #80a0cf - - -style 16 13 2 - - - -style 16 15 1 #8ca0c3 - - -style 16 16 68 - - - -style 16 84 1 #8ca0c3 - - -style 16 85 2 - - - -style 16 87 1 #80a0cf - - -style 16 88 2 - - - -style 16 90 1 #74a0db - - -style 16 91 2 - - - -style 16 93 1 #68a0e7 - - -style 16 94 2 - - - -style 16 96 1 #5ca0f3 - - -style 16 97 2 - - - -style 16 99 1 #50a0ff - - -style 17 0 1 #50a0ff - - -style 17 1 2 - - - -style 17 3 1 #5ca0f3 - - -style 17 4 2 - - - -style 17 6 1 #68a0e7 - - -style 17 7 2 - - - -style 17 9 1 #74a0db - - -style 17 10 2 - - - -style 17 12 1 #80a0cf - - -style 17 13 2 - - - -style 17 15 1 #8ca0c3 - - -style 17 16 68 - - - -style 17 84 1 #8ca0c3 - - -style 17 85 2 - - - -style 17 87 1 #80a0cf - - -style 17 88 2 - - - -style 17 90 1 #74a0db - - -style 17 91 2 - - - -style 17 93 1 #68a0e7 - - -style 17 94 2 - - - -style 17 96 1 #5ca0f3 - - -style 17 97 2 - - - -style 17 99 1 #50a0ff - - -style 18 0 1 #50a0ff - - -style 18 1 2 - - - -style 18 3 1 #5ca0f3 - - -style 18 4 2 - - - -style 18 6 1 #68a0e7 - - -style 18 7 2 - - - -style 18 9 1 #74a0db - - -style 18 10 2 - - - -style 18 12 1 #80a0cf - - -style 18 13 2 - - - -style 18 15 1 #8ca0c3 - - -style 18 16 2 - - - -style 18 18 64 #98a0b7 - - -style 18 82 2 - - - -style 18 84 1 #8ca0c3 - - -style 18 85 2 - - - -style 18 87 1 #80a0cf - - -style 18 88 2 - - - -style 18 90 1 #74a0db - - -style 18 91 2 - - - -style 18 93 1 #68a0e7 - - -style 18 94 2 - - - -style 18 96 1 #5ca0f3 - - -style 18 97 2 - - - -style 18 99 1 #50a0ff - - -style 19 0 1 #50a0ff - - -style 19 1 2 - - - -style 19 3 1 #5ca0f3 - - -style 19 4 2 - - - -style 19 6 1 #68a0e7 - - -style 19 7 2 - - - -style 19 9 1 #74a0db - - -style 19 10 2 - - - -style 19 12 1 #80a0cf - - -style 19 13 2 - - - -style 19 15 1 #8ca0c3 - - -style 19 16 2 - - - -style 19 18 1 #98a0b7 - - -style 19 19 62 - - - -style 19 81 1 #98a0b7 - - -style 19 82 2 - - - -style 19 84 1 #8ca0c3 - - -style 19 85 2 - - - -style 19 87 1 #80a0cf - - -style 19 88 2 - - - -style 19 90 1 #74a0db - - -style 19 91 2 - - - -style 19 93 1 #68a0e7 - - -style 19 94 2 - - - -style 19 96 1 #5ca0f3 - - -style 19 97 2 - - - -style 19 99 1 #50a0ff - - -style 20 0 1 #50a0ff - - -style 20 1 2 - - - -style 20 3 1 #5ca0f3 - - -style 20 4 2 - - - -style 20 6 1 #68a0e7 - - -style 20 7 2 - - - -style 20 9 1 #74a0db - - -style 20 10 2 - - - -style 20 12 1 #80a0cf - - -style 20 13 2 - - - -style 20 15 1 #8ca0c3 - - -style 20 16 2 - - - -style 20 18 1 #98a0b7 - - -style 20 19 62 - - - -style 20 81 1 #98a0b7 - - -style 20 82 2 - - - -style 20 84 1 #8ca0c3 - - -style 20 85 2 - - - -style 20 87 1 #80a0cf - - -style 20 88 2 - - - -style 20 90 1 #74a0db - - -style 20 91 2 - - - -style 20 93 1 #68a0e7 - - -style 20 94 2 - - - -style 20 96 1 #5ca0f3 - - -style 20 97 2 - - - -style 20 99 1 #50a0ff - - -style 21 0 1 #50a0ff - - -style 21 1 2 - - - -style 21 3 1 #5ca0f3 - - -style 21 4 2 - - - -style 21 6 1 #68a0e7 - - -style 21 7 2 - - - -style 21 9 1 #74a0db - - -style 21 10 2 - - - -style 21 12 1 #80a0cf - - -style 21 13 2 - - - -style 21 15 1 #8ca0c3 - - -style 21 16 2 - - - -style 21 18 1 #98a0b7 - - -style 21 19 2 - - - -style 21 21 58 #a4a0ab - - -style 21 79 2 - - - -style 21 81 1 #98a0b7 - - -style 21 82 2 - - - -style 21 84 1 #8ca0c3 - - -style 21 85 2 - - - -style 21 87 1 #80a0cf - - -style 21 88 2 - - - -style 21 90 1 #74a0db - - -style 21 91 2 - - - -style 21 93 1 #68a0e7 - - -style 21 94 2 - - - -style 21 96 1 #5ca0f3 - - -style 21 97 2 - - - -style 21 99 1 #50a0ff - - -style 22 0 1 #50a0ff - - -style 22 1 2 - - - -style 22 3 1 #5ca0f3 - - -style 22 4 2 - - - -style 22 6 1 #68a0e7 - - -style 22 7 2 - - - -style 22 9 1 #74a0db - - -style 22 10 2 - - - -style 22 12 1 #80a0cf - - -style 22 13 2 - - - -style 22 15 1 #8ca0c3 - - -style 22 16 2 - - - -style 22 18 1 #98a0b7 - - -style 22 19 2 - - - -style 22 21 1 #a4a0ab - - -style 22 22 56 - - - -style 22 78 1 #a4a0ab - - -style 22 79 2 - - - -style 22 81 1 #98a0b7 - - -style 22 82 2 - - - -style 22 84 1 #8ca0c3 - - -style 22 85 2 - - - -style 22 87 1 #80a0cf - - -style 22 88 2 - - - -style 22 90 1 #74a0db - - -style 22 91 2 - - - -style 22 93 1 #68a0e7 - - -style 22 94 2 - - - -style 22 96 1 #5ca0f3 - - -style 22 97 2 - - - -style 22 99 1 #50a0ff - - -style 23 0 1 #50a0ff - - -style 23 1 2 - - - -style 23 3 1 #5ca0f3 - - -style 23 4 2 - - - -style 23 6 1 #68a0e7 - - -style 23 7 2 - - - -style 23 9 1 #74a0db - - -style 23 10 2 - - - -style 23 12 1 #80a0cf - - -style 23 13 2 - - - -style 23 15 1 #8ca0c3 - - -style 23 16 2 - - - -style 23 18 1 #98a0b7 - - -style 23 19 2 - - - -style 23 21 1 #a4a0ab - - -style 23 22 56 - - - -style 23 78 1 #a4a0ab - - -style 23 79 2 - - - -style 23 81 1 #98a0b7 - - -style 23 82 2 - - - -style 23 84 1 #8ca0c3 - - -style 23 85 2 - - - -style 23 87 1 #80a0cf - - -style 23 88 2 - - - -style 23 90 1 #74a0db - - -style 23 91 2 - - - -style 23 93 1 #68a0e7 - - -style 23 94 2 - - - -style 23 96 1 #5ca0f3 - - -style 23 97 2 - - - -style 23 99 1 #50a0ff - - -style 24 0 1 #50a0ff - - -style 24 1 2 - - - -style 24 3 1 #5ca0f3 - - -style 24 4 2 - - - -style 24 6 1 #68a0e7 - - -style 24 7 2 - - - -style 24 9 1 #74a0db - - -style 24 10 2 - - - -style 24 12 1 #80a0cf - - -style 24 13 2 - - - -style 24 15 1 #8ca0c3 - - -style 24 16 2 - - - -style 24 18 1 #98a0b7 - - -style 24 19 2 - - - -style 24 21 1 #a4a0ab - - -style 24 22 2 - - - -style 24 24 52 #b0a09f - - -style 24 76 2 - - - -style 24 78 1 #a4a0ab - - -style 24 79 2 - - - -style 24 81 1 #98a0b7 - - -style 24 82 2 - - - -style 24 84 1 #8ca0c3 - - -style 24 85 2 - - - -style 24 87 1 #80a0cf - - -style 24 88 2 - - - -style 24 90 1 #74a0db - - -style 24 91 2 - - - -style 24 93 1 #68a0e7 - - -style 24 94 2 - - - -style 24 96 1 #5ca0f3 - - -style 24 97 2 - - - -style 24 99 1 #50a0ff - - -style 25 0 1 #50a0ff - - -style 25 1 2 - - - -style 25 3 1 #5ca0f3 - - -style 25 4 2 - - - -style 25 6 1 #68a0e7 - - -style 25 7 2 - - - -style 25 9 1 #74a0db - - -style 25 10 2 - - - -style 25 12 1 #80a0cf - - -style 25 13 2 - - - -style 25 15 1 #8ca0c3 - - -style 25 16 2 - - - -style 25 18 1 #98a0b7 - - -style 25 19 2 - - - -style 25 21 1 #a4a0ab - - -style 25 22 2 - - - -style 25 24 1 #b0a09f - - -style 25 25 50 - - - -style 25 75 1 #b0a09f - - -style 25 76 2 - - - -style 25 78 1 #a4a0ab - - -style 25 79 2 - - - -style 25 81 1 #98a0b7 - - -style 25 82 2 - - - -style 25 84 1 #8ca0c3 - - -style 25 85 2 - - - -style 25 87 1 #80a0cf - - -style 25 88 2 - - - -style 25 90 1 #74a0db - - -style 25 91 2 - - - -style 25 93 1 #68a0e7 - - -style 25 94 2 - - - -style 25 96 1 #5ca0f3 - - -style 25 97 2 - - - -style 25 99 1 #50a0ff - - -style 26 0 1 #50a0ff - - -style 26 1 2 - - - -style 26 3 1 #5ca0f3 - - -style 26 4 2 - - - -style 26 6 1 #68a0e7 - - -style 26 7 2 - - - -style 26 9 1 #74a0db - - -style 26 10 2 - - - -style 26 12 1 #80a0cf - - -style 26 13 2 - - - -style 26 15 1 #8ca0c3 - - -style 26 16 2 - - - -style 26 18 1 #98a0b7 - - -style 26 19 2 - - - -style 26 21 1 #a4a0ab - - -style 26 22 2 - - - -style 26 24 1 #b0a09f - - -style 26 25 50 - - - -style 26 75 1 #b0a09f - - -style 26 76 2 - - - -style 26 78 1 #a4a0ab - - -style 26 79 2 - - - -style 26 81 1 #98a0b7 - - -style 26 82 2 - - - -style 26 84 1 #8ca0c3 - - -style 26 85 2 - - - -style 26 87 1 #80a0cf - - -style 26 88 2 - - - -style 26 90 1 #74a0db - - -style 26 91 2 - - - -style 26 93 1 #68a0e7 - - -style 26 94 2 - - - -style 26 96 1 #5ca0f3 - - -style 26 97 2 - - - -style 26 99 1 #50a0ff - - -style 27 0 1 #50a0ff - - -style 27 1 2 - - - -style 27 3 1 #5ca0f3 - - -style 27 4 2 - - - -style 27 6 1 #68a0e7 - - -style 27 7 2 - - - -style 27 9 1 #74a0db - - -style 27 10 2 - - - -style 27 12 1 #80a0cf - - -style 27 13 2 - - - -style 27 15 1 #8ca0c3 - - -style 27 16 2 - - - -style 27 18 1 #98a0b7 - - -style 27 19 2 - - - -style 27 21 1 #a4a0ab - - -style 27 22 2 - - - -style 27 24 1 #b0a09f - - -style 27 25 2 - - - -style 27 27 46 #bca093 - - -style 27 73 2 - - - -style 27 75 1 #b0a09f - - -style 27 76 2 - - - -style 27 78 1 #a4a0ab - - -style 27 79 2 - - - -style 27 81 1 #98a0b7 - - -style 27 82 2 - - - -style 27 84 1 #8ca0c3 - - -style 27 85 2 - - - -style 27 87 1 #80a0cf - - -style 27 88 2 - - - -style 27 90 1 #74a0db - - -style 27 91 2 - - - -style 27 93 1 #68a0e7 - - -style 27 94 2 - - - -style 27 96 1 #5ca0f3 - - -style 27 97 2 - - - -style 27 99 1 #50a0ff - - -style 28 0 1 #50a0ff - - -style 28 1 2 - - - -style 28 3 1 #5ca0f3 - - -style 28 4 2 - - - -style 28 6 1 #68a0e7 - - -style 28 7 2 - - - -style 28 9 1 #74a0db - - -style 28 10 2 - - - -style 28 12 1 #80a0cf - - -style 28 13 2 - - - -style 28 15 1 #8ca0c3 - - -style 28 16 2 - - - -style 28 18 1 #98a0b7 - - -style 28 19 2 - - - -style 28 21 1 #a4a0ab - - -style 28 22 2 - - - -style 28 24 1 #b0a09f - - -style 28 25 2 - - - -style 28 27 1 #bca093 - - -style 28 28 44 - - - -style 28 72 1 #bca093 - - -style 28 73 2 - - - -style 28 75 1 #b0a09f - - -style 28 76 2 - - - -style 28 78 1 #a4a0ab - - -style 28 79 2 - - - -style 28 81 1 #98a0b7 - - -style 28 82 2 - - - -style 28 84 1 #8ca0c3 - - -style 28 85 2 - - - -style 28 87 1 #80a0cf - - -style 28 88 2 - - - -style 28 90 1 #74a0db - - -style 28 91 2 - - - -style 28 93 1 #68a0e7 - - -style 28 94 2 - - - -style 28 96 1 #5ca0f3 - - -style 28 97 2 - - - -style 28 99 1 #50a0ff - - -style 29 0 1 #50a0ff - - -style 29 1 2 - - - -style 29 3 1 #5ca0f3 - - -style 29 4 2 - - - -style 29 6 1 #68a0e7 - - -style 29 7 2 - - - -style 29 9 1 #74a0db - - -style 29 10 2 - - - -style 29 12 1 #80a0cf - - -style 29 13 2 - - - -style 29 15 1 #8ca0c3 - - -style 29 16 2 - - - -style 29 18 1 #98a0b7 - - -style 29 19 2 - - - -style 29 21 1 #a4a0ab - - -style 29 22 2 - - - -style 29 24 1 #b0a09f - - -style 29 25 2 - - - -style 29 27 1 #bca093 - - -style 29 28 44 - - - -style 29 72 1 #bca093 - - -style 29 73 2 - - - -style 29 75 1 #b0a09f - - -style 29 76 2 - - - -style 29 78 1 #a4a0ab - - -style 29 79 2 - - - -style 29 81 1 #98a0b7 - - -style 29 82 2 - - - -style 29 84 1 #8ca0c3 - - -style 29 85 2 - - - -style 29 87 1 #80a0cf - - -style 29 88 2 - - - -style 29 90 1 #74a0db - - -style 29 91 2 - - - -style 29 93 1 #68a0e7 - - -style 29 94 2 - - - -style 29 96 1 #5ca0f3 - - -style 29 97 2 - - - -style 29 99 1 #50a0ff - - -style 30 0 1 #50a0ff - - -style 30 1 2 - - - -style 30 3 1 #5ca0f3 - - -style 30 4 2 - - - -style 30 6 1 #68a0e7 - - -style 30 7 2 - - - -style 30 9 1 #74a0db - - -style 30 10 2 - - - -style 30 12 1 #80a0cf - - -style 30 13 2 - - - -style 30 15 1 #8ca0c3 - - -style 30 16 2 - - - -style 30 18 1 #98a0b7 - - -style 30 19 2 - - - -style 30 21 1 #a4a0ab - - -style 30 22 2 - - - -style 30 24 1 #b0a09f - - -style 30 25 2 - - - -style 30 27 1 #bca093 - - -style 30 28 2 - - - -style 30 30 40 #50a0ff - - -style 30 70 2 - - - -style 30 72 1 #bca093 - - -style 30 73 2 - - - -style 30 75 1 #b0a09f - - -style 30 76 2 - - - -style 30 78 1 #a4a0ab - - -style 30 79 2 - - - -style 30 81 1 #98a0b7 - - -style 30 82 2 - - - -style 30 84 1 #8ca0c3 - - -style 30 85 2 - - - -style 30 87 1 #80a0cf - - -style 30 88 2 - - - -style 30 90 1 #74a0db - - -style 30 91 2 - - - -style 30 93 1 #68a0e7 - - -style 30 94 2 - - - -style 30 96 1 #5ca0f3 - - -style 30 97 2 - - - -style 30 99 1 #50a0ff - - -style 31 0 1 #50a0ff - - -style 31 1 2 - - - -style 31 3 1 #5ca0f3 - - -style 31 4 2 - - - -style 31 6 1 #68a0e7 - - -style 31 7 2 - - - -style 31 9 1 #74a0db - - -style 31 10 2 - - - -style 31 12 1 #80a0cf - - -style 31 13 2 - - - -style 31 15 1 #8ca0c3 - - -style 31 16 2 - - - -style 31 18 1 #98a0b7 - - -style 31 19 2 - - - -style 31 21 1 #a4a0ab - - -style 31 22 2 - - - -style 31 24 1 #b0a09f - - -style 31 25 2 - - - -style 31 27 1 #bca093 - - -style 31 28 2 - - - -style 31 30 1 #50a0ff - - -style 31 31 38 - - - -style 31 69 1 #50a0ff - - -style 31 70 2 - - - -style 31 72 1 #bca093 - - -style 31 73 2 - - - -style 31 75 1 #b0a09f - - -style 31 76 2 - - - -style 31 78 1 #a4a0ab - - -style 31 79 2 - - - -style 31 81 1 #98a0b7 - - -style 31 82 2 - - - -style 31 84 1 #8ca0c3 - - -style 31 85 2 - - - -style 31 87 1 #80a0cf - - -style 31 88 2 - - - -style 31 90 1 #74a0db - - -style 31 91 2 - - - -style 31 93 1 #68a0e7 - - -style 31 94 2 - - - -style 31 96 1 #5ca0f3 - - -style 31 97 2 - - - -style 31 99 1 #50a0ff - - -style 32 0 1 #50a0ff - - -style 32 1 2 - - - -style 32 3 1 #5ca0f3 - - -style 32 4 2 - - - -style 32 6 1 #68a0e7 - - -style 32 7 2 - - - -style 32 9 1 #74a0db - - -style 32 10 2 - - - -style 32 12 1 #80a0cf - - -style 32 13 2 - - - -style 32 15 1 #8ca0c3 - - -style 32 16 2 - - - -style 32 18 1 #98a0b7 - - -style 32 19 2 - - - -style 32 21 1 #a4a0ab - - -style 32 22 2 - - - -style 32 24 1 #b0a09f - - -style 32 25 2 - - - -style 32 27 1 #bca093 - - -style 32 28 2 - - - -style 32 30 1 #50a0ff - - -style 32 31 38 - - - -style 32 69 1 #50a0ff - - -style 32 70 2 - - - -style 32 72 1 #bca093 - - -style 32 73 2 - - - -style 32 75 1 #b0a09f - - -style 32 76 2 - - - -style 32 78 1 #a4a0ab - - -style 32 79 2 - - - -style 32 81 1 #98a0b7 - - -style 32 82 2 - - - -style 32 84 1 #8ca0c3 - - -style 32 85 2 - - - -style 32 87 1 #80a0cf - - -style 32 88 2 - - - -style 32 90 1 #74a0db - - -style 32 91 2 - - - -style 32 93 1 #68a0e7 - - -style 32 94 2 - - - -style 32 96 1 #5ca0f3 - - -style 32 97 2 - - - -style 32 99 1 #50a0ff - - -style 33 0 1 #50a0ff - - -style 33 1 2 - - - -style 33 3 1 #5ca0f3 - - -style 33 4 2 - - - -style 33 6 1 #68a0e7 - - -style 33 7 2 - - - -style 33 9 1 #74a0db - - -style 33 10 2 - - - -style 33 12 1 #80a0cf - - -style 33 13 2 - - - -style 33 15 1 #8ca0c3 - - -style 33 16 2 - - - -style 33 18 1 #98a0b7 - - -style 33 19 2 - - - -style 33 21 1 #a4a0ab - - -style 33 22 2 - - - -style 33 24 1 #b0a09f - - -style 33 25 2 - - - -style 33 27 1 #bca093 - - -style 33 28 2 - - - -style 33 30 1 #50a0ff - - -style 33 31 2 - - - -style 33 33 34 #5ca0f3 - - -style 33 67 2 - - - -style 33 69 1 #50a0ff - - -style 33 70 2 - - - -style 33 72 1 #bca093 - - -style 33 73 2 - - - -style 33 75 1 #b0a09f - - -style 33 76 2 - - - -style 33 78 1 #a4a0ab - - -style 33 79 2 - - - -style 33 81 1 #98a0b7 - - -style 33 82 2 - - - -style 33 84 1 #8ca0c3 - - -style 33 85 2 - - - -style 33 87 1 #80a0cf - - -style 33 88 2 - - - -style 33 90 1 #74a0db - - -style 33 91 2 - - - -style 33 93 1 #68a0e7 - - -style 33 94 2 - - - -style 33 96 1 #5ca0f3 - - -style 33 97 2 - - - -style 33 99 1 #50a0ff - - -style 34 0 1 #50a0ff - - -style 34 1 2 - - - -style 34 3 1 #5ca0f3 - - -style 34 4 2 - - - -style 34 6 1 #68a0e7 - - -style 34 7 2 - - - -style 34 9 1 #74a0db - - -style 34 10 2 - - - -style 34 12 1 #80a0cf - - -style 34 13 2 - - - -style 34 15 1 #8ca0c3 - - -style 34 16 2 - - - -style 34 18 1 #98a0b7 - - -style 34 19 2 - - - -style 34 21 1 #a4a0ab - - -style 34 22 2 - - - -style 34 24 1 #b0a09f - - -style 34 25 2 - - - -style 34 27 1 #bca093 - - -style 34 28 2 - - - -style 34 30 1 #50a0ff - - -style 34 31 2 - - - -style 34 33 1 #5ca0f3 - - -style 34 34 32 - - - -style 34 66 1 #5ca0f3 - - -style 34 67 2 - - - -style 34 69 1 #50a0ff - - -style 34 70 2 - - - -style 34 72 1 #bca093 - - -style 34 73 2 - - - -style 34 75 1 #b0a09f - - -style 34 76 2 - - - -style 34 78 1 #a4a0ab - - -style 34 79 2 - - - -style 34 81 1 #98a0b7 - - -style 34 82 2 - - - -style 34 84 1 #8ca0c3 - - -style 34 85 2 - - - -style 34 87 1 #80a0cf - - -style 34 88 2 - - - -style 34 90 1 #74a0db - - -style 34 91 2 - - - -style 34 93 1 #68a0e7 - - -style 34 94 2 - - - -style 34 96 1 #5ca0f3 - - -style 34 97 2 - - - -style 34 99 1 #50a0ff - - -style 35 0 1 #50a0ff - - -style 35 1 2 - - - -style 35 3 1 #5ca0f3 - - -style 35 4 2 - - - -style 35 6 1 #68a0e7 - - -style 35 7 2 - - - -style 35 9 1 #74a0db - - -style 35 10 2 - - - -style 35 12 1 #80a0cf - - -style 35 13 2 - - - -style 35 15 1 #8ca0c3 - - -style 35 16 2 - - - -style 35 18 1 #98a0b7 - - -style 35 19 2 - - - -style 35 21 1 #a4a0ab - - -style 35 22 2 - - - -style 35 24 1 #b0a09f - - -style 35 25 2 - - - -style 35 27 1 #bca093 - - -style 35 28 2 - - - -style 35 30 1 #50a0ff - - -style 35 31 2 - - - -style 35 33 1 #5ca0f3 - - -style 35 34 32 - - - -style 35 66 1 #5ca0f3 - - -style 35 67 2 - - - -style 35 69 1 #50a0ff - - -style 35 70 2 - - - -style 35 72 1 #bca093 - - -style 35 73 2 - - - -style 35 75 1 #b0a09f - - -style 35 76 2 - - - -style 35 78 1 #a4a0ab - - -style 35 79 2 - - - -style 35 81 1 #98a0b7 - - -style 35 82 2 - - - -style 35 84 1 #8ca0c3 - - -style 35 85 2 - - - -style 35 87 1 #80a0cf - - -style 35 88 2 - - - -style 35 90 1 #74a0db - - -style 35 91 2 - - - -style 35 93 1 #68a0e7 - - -style 35 94 2 - - - -style 35 96 1 #5ca0f3 - - -style 35 97 2 - - - -style 35 99 1 #50a0ff - - -style 36 0 1 #50a0ff - - -style 36 1 2 - - - -style 36 3 1 #5ca0f3 - - -style 36 4 2 - - - -style 36 6 1 #68a0e7 - - -style 36 7 2 - - - -style 36 9 1 #74a0db - - -style 36 10 2 - - - -style 36 12 1 #80a0cf - - -style 36 13 2 - - - -style 36 15 1 #8ca0c3 - - -style 36 16 2 - - - -style 36 18 1 #98a0b7 - - -style 36 19 2 - - - -style 36 21 1 #a4a0ab - - -style 36 22 2 - - - -style 36 24 1 #b0a09f - - -style 36 25 2 - - - -style 36 27 1 #bca093 - - -style 36 28 2 - - - -style 36 30 1 #50a0ff - - -style 36 31 2 - - - -style 36 33 1 #5ca0f3 - - -style 36 34 2 - - - -style 36 36 28 #68a0e7 - - -style 36 64 2 - - - -style 36 66 1 #5ca0f3 - - -style 36 67 2 - - - -style 36 69 1 #50a0ff - - -style 36 70 2 - - - -style 36 72 1 #bca093 - - -style 36 73 2 - - - -style 36 75 1 #b0a09f - - -style 36 76 2 - - - -style 36 78 1 #a4a0ab - - -style 36 79 2 - - - -style 36 81 1 #98a0b7 - - -style 36 82 2 - - - -style 36 84 1 #8ca0c3 - - -style 36 85 2 - - - -style 36 87 1 #80a0cf - - -style 36 88 2 - - - -style 36 90 1 #74a0db - - -style 36 91 2 - - - -style 36 93 1 #68a0e7 - - -style 36 94 2 - - - -style 36 96 1 #5ca0f3 - - -style 36 97 2 - - - -style 36 99 1 #50a0ff - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +style 0 0 100 - - - +style 1 0 100 - - - +style 2 0 100 - - - +style 3 0 100 - - - +style 4 0 100 - - - +style 5 0 100 - - - +style 6 0 100 - - - +style 7 0 100 - - - +style 8 0 100 - - - +style 9 0 100 - - - +style 10 0 100 - - - +style 11 0 100 - - - +style 12 0 100 - - - +style 13 0 100 - - - +style 14 0 100 - - - +style 15 0 100 - - - +style 16 0 100 - - - +style 17 0 100 - - - +style 18 0 100 - - - +style 19 0 100 - - - +style 20 0 100 - - - +style 21 0 100 - - - +style 22 0 100 - - - +style 23 0 100 - - - +style 24 0 100 - - - +style 25 0 100 - - - +style 26 0 100 - - - +style 27 0 100 - - - +style 28 0 100 - - - +style 29 0 100 - - - +style 30 0 100 - - - +style 31 0 100 - - - +style 32 0 100 - - - +style 33 0 100 - - - +style 34 0 100 - - - +style 35 0 100 - - - +style 36 0 100 - - - diff --git a/crates/thing-tui/tests/goldens/screen-f12-text-edge-cells.txt b/crates/thing-tui/tests/goldens/screen-f12-text-edge-cells.txt index 32a50ec..46a8211 100644 --- a/crates/thing-tui/tests/goldens/screen-f12-text-edge-cells.txt +++ b/crates/thing-tui/tests/goldens/screen-f12-text-edge-cells.txt @@ -1,7 +1,18 @@ surface thing:surface:provider.text.text-edge 100x37 +Hello שלום עולם and مرحبا بالعالم then 123 end. +日本語テスト 你好世界 한국어 ABC123 +é ä ñ ộ z͛͏̀ - Hello שלום עולם and مرحبا بالعالم then 123 end. +👩‍👩‍👧‍👦 👨🏽‍💻 🏳️‍🌈 +The quick brown fox jumps over the lazy dog while the evening light slides across the valley, and +the long paragraph keeps going so that any reasonable column must break it across several lines. The +quick brown fox jumps over the lazy dog while the evening light slides across the valley, and the +long paragraph keeps going so that any reasonable column must break it across several lines. The +quick brown fox jumps over the lazy dog while the evening light slides across the valley, and the +long paragraph keeps going so that any reasonable column must break it across several lines. The +quick brown fox jumps over the lazy dog while the evening light slides across the valley, and the +long paragraph keeps going so that any reasonable column must break it across several lines. @@ -10,7 +21,6 @@ surface thing:surface:provider.text.text-edge 100x37 - 日本語テスト 你好世界 한국어 ABC123 @@ -19,7 +29,6 @@ surface thing:surface:provider.text.text-edge 100x37 - é ä ñ ộ z͛͏̀ @@ -27,42 +36,38 @@ surface thing:surface:provider.text.text-edge 100x37 - - 👩‍👩‍👧‍👦 👨🏽‍💻 🏳️‍🌈 - - - - - - - -style 0 0 100 - - - +style 0 0 47 #eeeef4 - - +style 0 47 53 - - - style 1 0 100 - - - -style 2 0 2 - - - -style 2 2 47 #eeeef4 - - -style 2 49 51 - - - -style 3 0 100 - - - +style 2 0 41 #eeeef4 - - +style 2 41 59 - - - +style 3 0 9 #eeeef4 - - +style 3 9 91 - - - style 4 0 100 - - - -style 5 0 100 - - - -style 6 0 100 - - - -style 7 0 100 - - - -style 8 0 100 - - - -style 9 0 100 - - - -style 10 0 100 - - - -style 11 0 2 - - - -style 11 2 41 #eeeef4 - - -style 11 43 57 - - - -style 12 0 100 - - - -style 13 0 100 - - - +style 5 0 8 #eeeef4 - - +style 5 8 92 - - - +style 6 0 97 #eeeef4 - - +style 6 97 3 - - - +style 7 0 100 #eeeef4 - - +style 8 0 97 #eeeef4 - - +style 8 97 3 - - - +style 9 0 96 #eeeef4 - - +style 9 96 4 - - - +style 10 0 97 #eeeef4 - - +style 10 97 3 - - - +style 11 0 96 #eeeef4 - - +style 11 96 4 - - - +style 12 0 97 #eeeef4 - - +style 12 97 3 - - - +style 13 0 93 #eeeef4 - - +style 13 93 7 - - - style 14 0 100 - - - style 15 0 100 - - - style 16 0 100 - - - style 17 0 100 - - - style 18 0 100 - - - style 19 0 100 - - - -style 20 0 2 - - - -style 20 2 9 #eeeef4 - - -style 20 11 89 - - - +style 20 0 100 - - - style 21 0 100 - - - style 22 0 100 - - - style 23 0 100 - - - @@ -71,9 +76,7 @@ style 25 0 100 - - - style 26 0 100 - - - style 27 0 100 - - - style 28 0 100 - - - -style 29 0 2 - - - -style 29 2 8 #eeeef4 - - -style 29 10 90 - - - +style 29 0 100 - - - style 30 0 100 - - - style 31 0 100 - - - style 32 0 100 - - - diff --git a/crates/thing-tui/tests/screen.rs b/crates/thing-tui/tests/screen.rs index 41a3be6..056e004 100644 --- a/crates/thing-tui/tests/screen.rs +++ b/crates/thing-tui/tests/screen.rs @@ -1,5 +1,7 @@ -//! Screen goldens: every fixture through resolve, bind, layout and render in Cells, painted onto a -//! 100x37 screen. The composition is test-only: the shipped crate composes nothing. +//! Screen goldens: every fixture, unedited, through resolve, bind, layout and render in Cells, +//! painted onto a 100x37 screen. A Px length of a fixture is a Px length in Cells too: it converts +//! at the cell metric (ruling cells-px-metric). The composition is test-only: the shipped crate +//! composes nothing. //! `THING_BLESS=1` rewrites the goldens through the testkit's one door. mod common; @@ -7,7 +9,7 @@ mod common; use std::path::PathBuf; use common::well_formed; -use thing_contract::{Border, ColorRef, Dimension, Edges, Node, Rgba, SurfaceDocument}; +use thing_contract::SurfaceDocument; use thing_core::bind::Binder; use thing_core::diagnostic::Code; use thing_core::layout::{LayoutFrame, Metrics, layout}; @@ -16,7 +18,6 @@ use thing_core::render::{RenderInput, ScrollOffsets, render}; use thing_core::resolve::{Limits, resolve}; use thing_core::text::CellMeasure; use thing_core::theme::Theme; -use thing_testkit::build::{px, size2}; use thing_testkit::fixture::Fixture; use thing_testkit::golden; use thing_testkit::mem_state::MemState; @@ -30,35 +31,6 @@ fn golden_dir() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/goldens") } -/// Three fixtures carry pixel sizes, which in Cells are numbers of cells: f03's 640x360 board and -/// f08's 320x180 viewport lie far off a 100x37 screen, and f11's chain of Boxes has no paint, so -/// it draws nothing in any mode. Each is cut down (or its boxes outlined) so that its Image, -/// Embed or boxes show on screen; every other fixture runs as authored. -fn as_cells(fixture: Fixture, node: &mut Node, depth: usize) { - match node { - Node::Box(b) => { - match fixture { - Fixture::F03InputTarget if b.common.id.as_str() == "root" => b.style.size = size2(px(60.0), px(20.0)), - Fixture::F03InputTarget if b.common.id.as_str() == "target" => { - b.style.inset = Edges { left: px(20.0), top: px(6.0), right: Dimension::Auto, bottom: Dimension::Auto }; - b.style.size = size2(px(12.0), px(3.0)); - } - Fixture::F11Deep => { - let shade = (depth * 12 % 120) as u8; - let color = ColorRef::Rgba(Rgba { r: 80 + shade, g: 160, b: 255 - shade, a: 255 }); - b.paint.border = Some(Border { color, width: 1.0 }); - } - _ => {} - } - for child in &mut b.children { - as_cells(fixture, child, depth + 1); - } - } - Node::Embed(e) if fixture == Fixture::F08EmbedViewport => (e.width, e.height) = (40.0, 10.0), - _ => {} - } -} - fn screen_of(state: &mut MemState, document: &SurfaceDocument) -> Result<(Screen, Painted), Code> { let limits = Limits::default(); let resolution = resolve(document, state, &limits); @@ -89,9 +61,7 @@ fn golden_text(fixture: Fixture) -> String { state::script(fixture, &mut state); let mut out = String::new(); for document in &set.surfaces { - let mut document = document.clone(); - as_cells(fixture, &mut document.root, 0); - match screen_of(&mut state, &document) { + match screen_of(&mut state, document) { Ok((screen, painted)) => { well_formed(&screen); out += &format!("surface {} {COLS}x{ROWS}\n{}", document.record_key(), screen.dump()); @@ -112,12 +82,12 @@ fn goldens() { } } -/// The substitutes the table promises show up on the screens that carry them. +/// The substitutes the table promises show up on the screens that carry them. f11 is a chain of +/// Boxes with no paint, so it draws nothing in any mode: its nesting is a layout fact, not a screen one. #[test] -fn image_embed_and_deep_boxes_are_on_screen() { +fn image_and_embed_are_on_screen() { let glyphs = |fixture| golden_text(fixture).lines().take(ROWS + 1).collect::(); let f03 = glyphs(Fixture::F03InputTarget); assert!(f03.contains('\u{2591}') && f03.contains("The board"), "f03 draws its Image as a shaded block with its alt"); assert!(golden_text(Fixture::F08EmbedViewport).contains("\nembed "), "f08 reports its Embed to the host"); - assert!(glyphs(Fixture::F11Deep).matches('\u{250c}').count() >= 10, "f11 shows its nested boxes"); }