diff --git a/assets/locales/pending/preferences-v2.json b/assets/locales/pending/preferences-v2.json new file mode 100644 index 000000000..60ba54424 --- /dev/null +++ b/assets/locales/pending/preferences-v2.json @@ -0,0 +1,10 @@ +{ + "ar": { "prefs.carousel_next": "التالي", "prefs.carousel_previous": "السابق" }, + "de": { "prefs.carousel_next": "Weiter", "prefs.carousel_previous": "Zurück" }, + "en": { "prefs.carousel_next": "Next", "prefs.carousel_previous": "Previous" }, + "he": { "prefs.carousel_next": "הבא", "prefs.carousel_previous": "הקודם" }, + "ja": { "prefs.carousel_next": "次へ", "prefs.carousel_previous": "前へ" }, + "ko": { "prefs.carousel_next": "다음", "prefs.carousel_previous": "이전" }, + "vi": { "prefs.carousel_next": "Tiếp", "prefs.carousel_previous": "Trước" }, + "zh": { "prefs.carousel_next": "下一个", "prefs.carousel_previous": "上一个" } +} diff --git a/assets/styles/ui/palettes.rs b/assets/styles/ui/palettes.rs index 201c45da7..442dde543 100644 --- a/assets/styles/ui/palettes.rs +++ b/assets/styles/ui/palettes.rs @@ -226,6 +226,28 @@ impl Tokens { dialog_label: Color32::from_rgb(58, 70, 86), selected_ink: Color32::from_rgb(26, 80, 127), selected_bg: Color32::from_rgb(232, 241, 250), + figure_ground: Color32::from_rgb(247, 248, 250), + figure_line: Color32::from_rgb(111, 124, 143), + figure_face_top: Color32::from_rgb(255, 255, 255), + figure_face_left: Color32::from_rgb(228, 233, 240), + figure_face_right: Color32::from_rgb(201, 210, 222), + figure_card: Color32::from_rgb(255, 255, 255), + figure_white: Color32::WHITE, + figure_black: Color32::BLACK, + figure_accent: Color32::from_rgb(35, 110, 173), + figure_reference: Color32::from_rgb(138, 83, 0), + figure_axis_x: Color32::from_rgb(214, 69, 69), + figure_axis_y: Color32::from_rgb(46, 158, 91), + figure_axis_z: Color32::from_rgb(47, 111, 208), + figure_ok: Color32::from_rgb(47, 125, 91), + figure_warn: Color32::from_rgb(201, 138, 0), + pref_well: Color32::from_rgb(238, 241, 245), + pref_note: Color32::from_rgb(184, 74, 0), + pref_note_fill: Color32::from_rgb(251, 235, 221), + pref_on_accent: Color32::from_rgb(255, 255, 255), + pref_ok: Color32::from_rgb(39, 107, 44), + pref_ok_fill: Color32::from_rgb(229, 242, 230), + pref_disabled: Color32::from_rgb(138, 148, 163), timeline_item: Color32::WHITE, timeline_item_error: Color32::from_rgb(250, 220, 220), timeline_marker: Color32::from_rgb(70, 76, 88), @@ -345,6 +367,26 @@ impl Tokens { t.dialog_label = t.text; t.selected_ink = Color32::from_rgb(156, 199, 245); t.selected_bg = Color32::from_rgb(42, 70, 110); + t.figure_ground = Color32::from_rgb(28, 31, 38); + t.figure_line = Color32::from_rgb(163, 174, 194); + t.figure_face_top = Color32::from_rgb(107, 119, 144); + t.figure_face_left = Color32::from_rgb(81, 91, 114); + t.figure_face_right = Color32::from_rgb(57, 66, 86); + t.figure_card = Color32::from_rgb(47, 52, 62); + t.figure_accent = Color32::from_rgb(140, 190, 245); + t.figure_reference = Color32::from_rgb(232, 194, 74); + t.figure_axis_x = Color32::from_rgb(242, 122, 122); + t.figure_axis_y = Color32::from_rgb(98, 212, 142); + t.figure_axis_z = Color32::from_rgb(108, 168, 247); + t.figure_ok = Color32::from_rgb(127, 209, 174); + t.figure_warn = Color32::from_rgb(232, 194, 74); + t.pref_well = Color32::from_rgb(47, 52, 62); + t.pref_note = Color32::from_rgb(240, 162, 122); + t.pref_note_fill = Color32::from_rgb(74, 51, 38); + t.pref_on_accent = Color32::from_rgb(15, 22, 32); + t.pref_ok = Color32::from_rgb(127, 209, 174); + t.pref_ok_fill = Color32::from_rgb(31, 58, 49); + t.pref_disabled = Color32::from_rgb(138, 148, 163); t.construction_geom = icon_primary(crate::icon_svg::CONSTRUCTION_PRIMARY[1]); t.error = Color32::from_rgb(240, 100, 96); t.sketch_conflict = t.error; diff --git a/crates/ui-egui/src/colour_tokens_tests.rs b/crates/ui-egui/src/colour_tokens_tests.rs index 8be8a444c..28188e185 100644 --- a/crates/ui-egui/src/colour_tokens_tests.rs +++ b/crates/ui-egui/src/colour_tokens_tests.rs @@ -31,6 +31,8 @@ fn moved_colours_keep_the_values_they_were_drawn_with() { assert_eq!(t.logo, [Color32::from_rgb(96, 158, 236), Color32::from_rgb(58, 136, 238), Color32::from_rgb(55, 108, 197)]); assert_eq!(t.icons.marker_halo, Color32::from_black_alpha(150)); assert_eq!(t.icons.agent, Color32::from_rgb(168, 85, 247)); + assert_eq!(t.figure_white, Color32::WHITE); + assert_eq!(t.figure_black, Color32::BLACK); } let (l, d) = (Tokens::light(), Tokens::dark()); assert_eq!((l.bend_up, l.bend_down), (Color32::from_rgb(30, 140, 50), Color32::from_rgb(200, 90, 20))); diff --git a/crates/ui-egui/src/colour_vision_tests.rs b/crates/ui-egui/src/colour_vision_tests.rs index 5e9fdbe78..4c046de44 100644 --- a/crates/ui-egui/src/colour_vision_tests.rs +++ b/crates/ui-egui/src/colour_vision_tests.rs @@ -396,6 +396,35 @@ fn groups(t: &Tokens) -> Vec { out.push(group(name, &[(key, fill)], &[("panel", t.panel)])); } out.push(group("dark pill text", &[("tab_on_fill_dark", t.tab_on_fill_dark)], &[("mesh_fill", t.mesh_fill)])); + // Miniature figures identify axes by labels and direction, reference points by + // position. Each ink must remain visible on its surfaces; + // the hues are not the only way to distinguish these marks from one another. + for (key, ink) in [ + ("figure_line", t.figure_line), + ("figure_accent", t.figure_accent), + ("figure_reference", t.figure_reference), + ("figure_axis_x", t.figure_axis_x), + ("figure_axis_y", t.figure_axis_y), + ("figure_axis_z", t.figure_axis_z), + ("figure_ok", t.figure_ok), + ("figure_warn", t.figure_warn), + ] { + out.push(group(key, &[(key, ink)], &[("figure_ground", t.figure_ground), ("figure_card", t.figure_card)])); + } + // The static sketch-state illustration uses success and warm alert inks on + // the top face. Keep success apart from each alert; the two warm warning + // shades are not a colour-only legend for live solver states. + out.push(group( + "preferences sketch states", + &[("figure_ok", t.figure_ok), ("figure_warn", t.figure_warn)], + &[("figure_face_top", t.figure_face_top)], + )); + out.push(group("preferences sketch note", &[("figure_ok", t.figure_ok), ("pref_note", t.pref_note)], &[("figure_face_top", t.figure_face_top)])); + // Badge words identify the status; check the ink against its own fill, as for + // tab text above, rather than treating an ink and its tint as competing states. + out.push(group("preferences note", &[("pref_note", t.pref_note)], &[("pref_note_fill", t.pref_note_fill)])); + out.push(group("preferences success", &[("pref_ok", t.pref_ok)], &[("pref_ok_fill", t.pref_ok_fill)])); + out.push(group("preferences accent ink", &[("pref_on_accent", t.pref_on_accent)], &[("form_primary", t.form_primary)])); // The removed part of a cut preview is translucent over the body. if let Some(sel) = out.iter_mut().find(|g| g.name == "selection") { sel.members.push(("preview_cut", over(t.preview_cut, t.body))); @@ -409,6 +438,12 @@ const SHADED: [&str; 2] = ["analysis.draft", "analysis.access"]; /// Tokens no colour vision mode needs to keep apart, and why. A new token fails /// `every_token_is_measured_or_carries_no_meaning` until it is in a group above or here. const NO_MEANING: &[(&str, &str)] = &[ + ("figure_face_left", "neutral cube shading; face geometry identifies the orientation"), + ("figure_face_right", "neutral cube shading; face geometry identifies the orientation"), + ("figure_white", "neutral axis label and highlight ink; letters identify the axes"), + ("figure_black", "neutral hatching and shadows; pattern and geometry carry the meaning"), + ("pref_well", "neutral well behind a labelled control or illustration"), + ("pref_disabled", "dimmed control ink; label and disabled interaction identify availability"), ("nav_hover", "neutral hover surface; placement and pointer feedback identify the control"), ("nav_press", "neutral pressed/open surface; interaction and menu presence identify the state"), ("nav_dim", "neutral secondary ink; the Later label identifies the unavailable option"), diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index e6616aaa0..da0952af4 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -1187,6 +1187,50 @@ pub struct Tokens { pub dialog_label: Color32, pub selected_ink: Color32, pub selected_bg: Color32, + /// Ground under every Preferences figure. + pub figure_ground: Color32, + /// Outlines and reference lines of Preferences figures. + pub figure_line: Color32, + /// Top face of the Preferences figure cube. + pub figure_face_top: Color32, + /// Left face of the Preferences figure cube. + pub figure_face_left: Color32, + /// Right face of the Preferences figure cube. + pub figure_face_right: Color32, + /// Paper, panels and pads drawn inside Preferences figures. + pub figure_card: Color32, + /// Fixed white label and highlight ink inside Preferences illustrations. + pub figure_white: Color32, + /// Fixed black hatch and shadow ink inside Preferences illustrations. + pub figure_black: Color32, + /// What a Preferences figure or selected card acts on. + pub figure_accent: Color32, + /// Reference point in a Preferences figure: pivot, origin, pointer. + pub figure_reference: Color32, + /// X axis in a Preferences figure. + pub figure_axis_x: Color32, + /// Y axis in a Preferences figure. + pub figure_axis_y: Color32, + /// Z axis in a Preferences figure. + pub figure_axis_z: Color32, + /// Done or fully constrained mark in a Preferences figure. + pub figure_ok: Color32, + /// Warning mark in a Preferences figure. + pub figure_warn: Color32, + /// Segmented control well and tint behind figures in Preferences. + pub pref_well: Color32, + /// Warning badge text and stroke in Preferences. + pub pref_note: Color32, + /// Warning badge fill in Preferences. + pub pref_note_fill: Color32, + /// Ink on a Preferences accent fill. + pub pref_on_accent: Color32, + /// Success badge text in Preferences. + pub pref_ok: Color32, + /// Success badge fill in Preferences. + pub pref_ok_fill: Color32, + /// Ink of a dimmed Preferences control. + pub pref_disabled: Color32, /// Timeline items: normal and failed. pub timeline_item: Color32, pub timeline_item_error: Color32, diff --git a/crates/ui-egui/src/theme_files.rs b/crates/ui-egui/src/theme_files.rs index fda8da471..ecd761a62 100644 --- a/crates/ui-egui/src/theme_files.rs +++ b/crates/ui-egui/src/theme_files.rs @@ -470,6 +470,7 @@ macro_rules! theme_keys { form_card_width: _, form_icon_size: _, form_close_size: _, form_inset: _, form_icon_inset: _, form_section_icon_size: _, form_checkbox_height: _, form_button_height: _, sketch_palette_width: _, sketch_mode_size: _, sketch_mode_radius: _, sketch_mode_border: _, sketch_palette_alpha: _, sketch_mode_tint: _, sketch_footer_icon_size: _, font_section_tracking: _, + figure_ground: _, figure_line: _, figure_face_top: _, figure_face_left: _, figure_face_right: _, figure_card: _, figure_white: _, figure_black: _, figure_accent: _, figure_reference: _, figure_axis_x: _, figure_axis_y: _, figure_axis_z: _, figure_ok: _, figure_warn: _, pref_well: _, pref_note: _, pref_note_fill: _, pref_on_accent: _, pref_ok: _, pref_ok_fill: _, pref_disabled: _, } = t; let IconColors { $($ione: _,)* } = &t.icons; } diff --git a/crates/ui-egui/src/ui_kit/gallery.rs b/crates/ui-egui/src/ui_kit/gallery.rs index 30c1a1ad4..1897f4177 100644 --- a/crates/ui-egui/src/ui_kit/gallery.rs +++ b/crates/ui-egui/src/ui_kit/gallery.rs @@ -1,4 +1,5 @@ //! Table-driven layout/paint references in both themes. No window or GPU required. +use super::preferences_figures::{ThemeSample, paint_theme_system, paint_theme_thumbnail}; use super::*; use crate::ui_kit::{Container, Surface}; use crate::{scenario, theme::Tokens}; @@ -530,6 +531,177 @@ const ELEMENTS: &[Element] = &[ }, ); }), + element!("picture_card", |ui, _| { + use super::preferences_figure_data as figures; + let gap = ui.spacing().item_spacing.x; + let width = card_width(ui.available_width(), 4, gap); + ui.horizontal(|ui| { + picture_card( + ui, + &Card { + label: "Coarse", + sub: Some("fastest"), + selected: false, + enabled: true, + options: None, + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_tess_coarse, + }, + width, + ); + picture_card( + ui, + &Card { + label: "Normal", + sub: Some("default"), + selected: true, + enabled: true, + options: None, + check: true, + aspect: 120.0 / 64.0, + figure: &figures::paint_tess_normal, + }, + width, + ); + picture_card( + ui, + &Card { + label: "Fine", + sub: Some("smoother"), + selected: false, + enabled: true, + options: Some("Has options"), + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_tess_fine, + }, + width, + ); + picture_card( + ui, + &Card { + label: "8×", + sub: Some("not on this GPU"), + selected: false, + enabled: false, + options: None, + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_aa_8x, + }, + width, + ); + }); + }), + element!("toggle_tile", |ui, _| { + use super::preferences_figure_data as figures; + let gap = ui.spacing().item_spacing.x; + let width = card_width(ui.available_width(), 3, gap); + ui.horizontal(|ui| { + toggle_tile( + ui, + &Card { + label: "Grid", + sub: None, + selected: true, + enabled: true, + options: None, + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_view_grid, + }, + width, + ); + toggle_tile( + ui, + &Card { + label: "Ground shadow", + sub: None, + selected: false, + enabled: true, + options: None, + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_view_shadow, + }, + width, + ); + toggle_tile( + ui, + &Card { + label: "Perspective", + sub: None, + selected: false, + enabled: false, + options: None, + check: false, + aspect: 120.0 / 64.0, + figure: &figures::paint_view_perspective, + }, + width, + ); + }); + }), + element!("preset_card", |ui, _| { + let icon = |p: &egui::Painter, r: egui::Rect, ink: egui::Color32| crate::icons::paint_ink(p, r, "settings", ink); + let width = ui.available_width(); + for (name, word, selected, enabled) in + [("Performance", "Fastest", false, true), ("Quality", "Sharpest", true, true), ("Custom", "Your own mix", false, false)] + { + preset_card(ui, name, word, selected, enabled, &icon, width); + } + }), + element!("help_icon", |ui, _| { + ui.horizontal(|ui| { + text(ui, "Anti-aliasing", Text::Hint("gallery_help")); + help_icon(ui, "Applies when SolidCraft restarts."); + }); + }), + element!("carousel", |ui, _| { + let sample = ThemeSample::from_tokens(&Tokens::get()); + let width = Tokens::get().space_24 * 2.0 + Tokens::get().space_24; + carousel(ui, "gallery_carousel", 6, width, width * 0.8, |ui, index| { + let label = ["Light", "Dark", "System", "Gruvbox", "Studio", "Mono"][index % 6]; + picture_card( + ui, + &Card { + label, + sub: Some("Built in"), + selected: index == 1, + enabled: true, + options: None, + check: false, + aspect: 124.0 / 76.0, + figure: &|p, r| paint_theme_thumbnail(p, r, &sample), + }, + width, + ); + }); + }), + element!("preference_theme_thumbnails", |ui, _| { + let (light, dark) = (ThemeSample::from_tokens(&Tokens::light()), ThemeSample::from_tokens(&Tokens::dark())); + ui.horizontal(|ui| { + for kind in 0..3 { + let (rect, _) = ui.allocate_exact_size(vec2(88.0, 88.0 * 76.0 / 124.0), egui::Sense::hover()); + match kind { + 0 => paint_theme_thumbnail(ui.painter(), rect, &light), + 1 => paint_theme_thumbnail(ui.painter(), rect, &dark), + _ => paint_theme_system(ui.painter(), rect, &light, &dark), + } + } + }); + }), + element!("preference_figures", |ui, _| { + ui.horizontal_wrapped(|ui| { + for (name, size, paint) in super::preferences_figure_data::FIGURES { + let width = 96.0; + let (rect, response) = ui.allocate_exact_size(vec2(width, width * size[1] / size[0]), egui::Sense::hover()); + paint(ui.painter(), rect); + response.on_hover_text(*name); + } + }); + }), element!("preference_option_cards", |ui, _| { ui.horizontal_wrapped(|ui| { for figure in [ @@ -1956,6 +2128,7 @@ fn gallery_covers_every_inline_element() { "look_chain.rs", "menu.rs", "metrics.rs", + "preferences_cards.rs", "radial.rs", "reports.rs", "sphere.rs", @@ -2567,3 +2740,177 @@ fn tree_icon_actions_keep_repeated_light_rows_independent() { }); assert_eq!(ids.len(), 3); } + +#[test] +fn card_looks_follow_selected_hover_disabled_and_focus() { + use super::preferences_cards::{CardFill, CardInk, card_look}; + let rest = card_look(false, true, false, false); + assert_eq!((rest.border, rest.fill, rest.ink, rest.bold, rest.alpha, rest.focus_ring), (1.0, CardFill::Face, CardInk::Text, false, 1.0, false)); + let hover = card_look(false, true, true, false); + assert_eq!(hover.fill, CardFill::Hover); + let selected = card_look(true, true, true, false); + assert_eq!((selected.border, selected.fill, selected.ink, selected.bold), (2.0, CardFill::Selected, CardInk::Accent, true)); + let disabled = card_look(false, false, true, true); + assert_eq!((disabled.fill, disabled.alpha, disabled.focus_ring), (CardFill::Face, 0.5, false), "a disabled card neither hovers nor shows focus"); + assert!(card_look(false, true, false, true).focus_ring); + assert!(card_look(true, false, false, false).alpha < 1.0, "a selected card can be disabled too"); +} + +#[test] +fn cards_size_to_their_container_and_survive_hostile_sizes() { + use super::preferences_cards::{card_width, carousel_window}; + assert_eq!(card_width(320.0, 4, 10.0), 72.5); + assert_eq!(card_width(320.0, 0, 10.0), 320.0); + for bad in [0.0, -5.0, f32::NAN, f32::INFINITY, f32::MAX] { + let w = card_width(bad, 3, 10.0); + assert!(w.is_finite() && w >= 0.0, "{bad}: {w}"); + let (first, visible) = carousel_window(5, 9, bad, 88.0, 8.0, 26.0); + assert!(first + visible <= 5 && visible >= 1, "{bad}: {first} {visible}"); + } + assert_eq!(carousel_window(0, 3, 400.0, 88.0, 8.0, 26.0), (0, 0)); + // 400 wide: two arrows and their gaps leave 332, which fits three 88-wide items with gaps. + assert_eq!(carousel_window(6, 0, 400.0, 88.0, 8.0, 26.0), (0, 3)); + assert_eq!(carousel_window(6, 5, 400.0, 88.0, 8.0, 26.0), (3, 3), "the offset stops at the last full window"); +} + +fn sample_card<'a>(label: &'a str, selected: bool, enabled: bool) -> super::preferences_cards::Card<'a> { + super::preferences_cards::Card { + label, + sub: Some("sub"), + selected, + enabled, + options: None, + check: selected, + aspect: 120.0 / 64.0, + figure: &super::preferences_figure_data::paint_tess_normal, + } +} + +#[test] +fn picture_cards_and_tiles_click_only_when_enabled_and_never_panic() { + use super::preferences_cards::{picture_card, toggle_tile}; + let ctx = crate::fonts::test_context(); + for tile in [false, true] { + for enabled in [true, false] { + let mut clicked = false; + let mut at = None; + for pass in 0..3 { + let events = match (pass, at) { + (1, Some(p)) => super::test_support::pointer(p, true), + (2, Some(p)) => super::test_support::pointer(p, false), + _ => vec![], + }; + super::test_support::frame(&ctx, events, |ui| { + let card = sample_card("Normal", false, enabled); + let response = if tile { toggle_tile(ui, &card, 120.0) } else { picture_card(ui, &card, 120.0) }; + at = Some(response.rect.center()); + assert!(response.rect.width() == 120.0 && response.rect.height() > 40.0); + clicked |= response.clicked(); + }); + } + assert_eq!(clicked, enabled, "tile {tile}, enabled {enabled}"); + // Zero, negative and non-finite widths must not panic and must stay finite. + super::test_support::frame(&ctx, vec![], |ui| { + for width in [0.0, -3.0, f32::NAN, f32::INFINITY, 1.0e6] { + let response = if tile { + toggle_tile(ui, &sample_card("x", true, enabled), width) + } else { + picture_card(ui, &sample_card("x", true, enabled), width) + }; + assert!(response.rect.is_finite()); + } + }); + } + } +} + +#[test] +fn preset_card_help_icon_and_carousel_behave() { + use super::preferences_cards::{carousel, help_icon, preset_card}; + let ctx = crate::fonts::test_context(); + let icon = |p: &egui::Painter, r: egui::Rect, ink: egui::Color32| crate::icons::paint_ink(p, r, "settings", ink); + super::test_support::frame(&ctx, vec![], |ui| { + for width in [0.0, 10.0, 204.0, f32::NAN] { + let response = preset_card(ui, "Performance", "Fastest", true, true, &icon, width); + assert!(response.rect.is_finite()); + } + let help = help_icon(ui, "Help text"); + assert!(help.rect.width() > 8.0 && help.rect.width() < 20.0); + }); + // The next arrow moves the window by one and stays inert at the end. + let mut first = vec![]; + let mut at = None; + for pass in 0..6 { + let events = match (pass, at) { + (2, Some(p)) => super::test_support::pointer(p, true), + (3, Some(p)) => super::test_support::pointer(p, false), + _ => vec![], + }; + super::test_support::frame(&ctx, events, |ui| { + let (f, visible) = carousel(ui, "carousel_test", 5, 60.0, 40.0, |ui, _| { + ui.allocate_exact_size(egui::vec2(60.0, 40.0), egui::Sense::hover()); + }); + first.push((f, visible)); + if let Some(rect) = scenario::rect_of("prefs:carousel:Next") { + at = Some(rect.center()); + } + }); + } + let (f0, visible) = first[0]; + assert_eq!(f0, 0); + assert!((1..5).contains(&visible), "{visible}"); + assert!(first.last().unwrap().0 >= 1, "the next arrow advanced the window: {first:?}"); +} + +/// Light and dark boards of the shared Preferences widgets and of every figure, rendered on the CPU. +/// Set `SOLIDCRAFT_PREFERENCE_WIDGET_EVIDENCE` to a directory to keep the PNGs. +#[test] +fn preference_widgets_and_figures_board_in_both_themes() { + use super::checks::tests::{raster, textures_update}; + use std::collections::HashMap; + let previous = crate::theme::is_dark(); + for dark in [false, true] { + crate::theme::set_dark(dark); + for (board, names) in [ + ("widgets", &["picture_card", "toggle_tile", "preset_card", "help_icon", "carousel", "preference_theme_thumbnails"][..]), + ("figures", &["preference_figures"][..]), + ] { + for scale in [1.0_f32, 2.0] { + let ctx = crate::fonts::test_context(); + ctx.set_pixels_per_point(scale); + let bounds = egui::Rect::from_min_size( + egui::Pos2::ZERO, + vec2(if board == "figures" { 700.0 } else { 360.0 }, if board == "figures" { 920.0 } else { 800.0 }), + ); + let mut textures = HashMap::new(); + let mut image = None; + for _ in 0..3 { + let mut output = ctx.run_ui(egui::RawInput { screen_rect: Some(bounds), ..Default::default() }, |ui| { + ui.set_width(bounds.width() - 40.0); + ui.painter().rect_filled(bounds, 0.0, Tokens::get().dialog_body); + ui.add_space(12.0); + scope(ui, |ui| { + for name in names { + example(ui, ELEMENTS.iter().find(|e| e.name == *name).unwrap()); + ui.add_space(Tokens::get().space_12); + } + }); + }); + textures_update(&mut textures, &output.textures_delta); + output.textures_delta.clear(); + image = Some(raster(&ctx, output.shapes, output.pixels_per_point, bounds, &textures)); + } + let image = image.unwrap(); + assert!(image.pixels().any(|p| p.0[3] != 0)); + if let Some(dir) = std::env::var_os("SOLIDCRAFT_PREFERENCE_WIDGET_EVIDENCE") { + std::fs::create_dir_all(&dir).unwrap(); + let suffix = if scale > 1.0 { "@2x" } else { "" }; + image + .save(std::path::Path::new(&dir).join(format!("preferences-{board}-{}{suffix}.png", if dark { "dark" } else { "light" }))) + .unwrap(); + } + } + } + } + crate::theme::set_dark(previous); +} diff --git a/crates/ui-egui/src/ui_kit/mod.rs b/crates/ui-egui/src/ui_kit/mod.rs index c280159ca..06ea66cde 100644 --- a/crates/ui-egui/src/ui_kit/mod.rs +++ b/crates/ui-egui/src/ui_kit/mod.rs @@ -28,6 +28,12 @@ mod navigation_settings; pub(crate) mod panel; mod preferences; mod preferences_assistant; +#[allow(dead_code, reason = "composed by the Preferences pages of #9875 to #9883")] +mod preferences_cards; +#[allow(dead_code, reason = "painted by the Preferences pages of #9875 to #9883")] +mod preferences_figure_data; +#[allow(dead_code, reason = "painted by the Preferences pages of #9875 to #9883")] +mod preferences_figure_ops; mod preferences_figures; mod preferences_layout; mod preferences_navigation; @@ -85,6 +91,8 @@ pub use panel::{DialogButtons, Window}; pub(crate) use panel::{collapsible_header, header}; pub(crate) use preferences::*; pub(crate) use preferences_assistant::*; +#[allow(unused_imports, reason = "composed by the Preferences pages of #9875 to #9883")] +pub(crate) use preferences_cards::*; pub(crate) use preferences_navigation::*; pub(crate) use preferences_small::*; pub(crate) use radial::{RADIAL_RADIUS, radial_menu}; diff --git a/crates/ui-egui/src/ui_kit/preferences.rs b/crates/ui-egui/src/ui_kit/preferences.rs index 0275e5ee7..470345cf0 100644 --- a/crates/ui-egui/src/ui_kit/preferences.rs +++ b/crates/ui-egui/src/ui_kit/preferences.rs @@ -729,7 +729,7 @@ pub(crate) fn option_card(ui: &mut Ui, label: &str, note: Option<&str>, selected if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response } } -fn centred_text(p: &egui::Painter, rect: Rect, label: &str, font: FontId, ink: Color32) { +pub(super) fn centred_text(p: &egui::Painter, rect: Rect, label: &str, font: FontId, ink: Color32) { centred_text_rows(p, rect, label, font, ink, 1); } diff --git a/crates/ui-egui/src/ui_kit/preferences_cards.rs b/crates/ui-egui/src/ui_kit/preferences_cards.rs new file mode 100644 index 000000000..7b227d209 --- /dev/null +++ b/crates/ui-egui/src/ui_kit/preferences_cards.rs @@ -0,0 +1,319 @@ +//! The controls the redesigned Preferences pages share: picture cards, toggle tiles, preset cards, +//! the hover-help icon and the carousel. Sizes follow `docs/design/preferences/measurements.md`; +//! every colour comes from `Tokens`. A card sizes to the width its container gives it and its +//! figure keeps the figure's aspect ratio. +use super::{metrics::dimension, preferences::centred_text}; +use crate::{scenario, theme::Tokens}; +use egui::{Color32, FontId, Painter, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; + +/// How a card or tile looks in a state. Kept separate from painting so the state rules can be tested. +#[derive(Clone, Copy, Debug, PartialEq)] +pub(crate) struct CardLook { + /// Border width in points: 2 when selected, else 1. + pub border: f32, + pub fill: CardFill, + pub ink: CardInk, + pub bold: bool, + /// Multiplier on every colour; a disabled card is dimmed. + pub alpha: f32, + /// A keyboard focus ring outside the border. + pub focus_ring: bool, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum CardFill { + Face, + Hover, + Selected, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum CardInk { + Text, + Accent, +} + +pub(super) fn card_look(selected: bool, enabled: bool, hovered: bool, focused: bool) -> CardLook { + CardLook { + border: if selected { 2.0 } else { 1.0 }, + fill: if selected { + CardFill::Selected + } else if enabled && hovered { + CardFill::Hover + } else { + CardFill::Face + }, + ink: if selected { CardInk::Accent } else { CardInk::Text }, + bold: selected, + alpha: if enabled { 1.0 } else { 0.5 }, + focus_ring: enabled && focused, + } +} + +/// What a picture card or toggle tile shows. +pub(crate) struct Card<'a> { + pub label: &'a str, + /// One short line under the label ("default", "Built in"). + pub sub: Option<&'a str>, + /// Selected (radio) or on (tile). + pub selected: bool, + pub enabled: bool, + /// The small "has options" disc at the top right. + pub options: Option<&'a str>, + /// An accent check at the top right (picture cards only). + pub check: bool, + /// Width over height of the figure. + pub aspect: f32, + pub figure: &'a dyn Fn(&Painter, Rect), +} + +/// The width of one of `columns` cards in `available` points with `gap` between them. +pub(super) fn card_width(available: f32, columns: usize, gap: f32) -> f32 { + let columns = columns.max(1) as f32; + let available = dimension(available); + ((available - gap.max(0.0) * (columns - 1.0)) / columns).max(0.0) +} + +fn card_height(t: &Tokens, width: f32, card: &Card) -> f32 { + let pad = t.space_6; + let aspect = if card.aspect.is_finite() && card.aspect > 0.01 { card.aspect } else { 1.0 }; + let figure = ((width - 2.0 * pad).max(0.0) / aspect).min(dimension(f32::MAX)); + let sub = if card.sub.is_some() { t.space_14 } else { 0.0 }; + pad + figure + gap(t) + t.space_16 + sub + pad + 1.0 +} + +fn gap(t: &Tokens) -> f32 { + (t.space_4 + t.space_6) * 0.5 +} + +fn paint_card(ui: &mut Ui, card: &Card, width: f32, tile: bool) -> Response { + let t = Tokens::get(); + let width = dimension(width); + let enabled = card.enabled && ui.is_enabled(); + let (rect, response) = ui.allocate_exact_size(vec2(width, card_height(&t, width, card)), if enabled { Sense::click() } else { Sense::hover() }); + let look = card_look(card.selected, enabled, response.hovered(), response.has_focus()); + let p = ui.painter(); + let dim = |c: Color32| c.gamma_multiply(look.alpha); + let fill = match look.fill { + CardFill::Selected => t.selected_bg, + CardFill::Hover => t.hover, + CardFill::Face => t.control_fill, + }; + let border = if card.selected { t.form_primary } else { t.dialog_border }; + let radius = f32::from(t.radius_lg); + p.rect(rect, radius, dim(fill), Stroke::new(look.border, dim(border)), StrokeKind::Inside); + if look.focus_ring { + p.rect_stroke(rect.expand(t.space_2), radius + t.space_2, Stroke::new(t.space_2, t.form_primary), StrokeKind::Outside); + } + let inset = t.space_6; + let figure = Rect::from_min_size( + rect.min + vec2(inset, inset), + vec2((rect.width() - 2.0 * inset).max(0.0), ((rect.width() - 2.0 * inset).max(0.0) / card.aspect.max(0.01)).min(rect.height())), + ); + if figure.is_positive() { + let figure_painter = p.with_clip_rect(figure.intersect(p.clip_rect())); + (card.figure)(&figure_painter, figure); + if !enabled { + p.rect_filled(figure, 0.0, t.control_fill.gamma_multiply(0.5)); + } + } + let ink = match look.ink { + CardInk::Accent => t.selected_ink, + CardInk::Text => t.form_ink, + }; + let font = if look.bold { crate::fonts::semibold(t.font_label) } else { FontId::proportional(t.font_label) }; + let label_rect = + Rect::from_min_size(pos2(rect.left() + t.space_2, figure.bottom() + gap(&t)), vec2((rect.width() - 2.0 * t.space_2).max(0.0), t.space_16)); + centred_text(p, label_rect, card.label, font, dim(ink)); + if let Some(sub) = card.sub { + let sub_rect = Rect::from_min_size(pos2(label_rect.left(), label_rect.bottom()), vec2(label_rect.width(), t.space_14)); + centred_text(p, sub_rect, sub, FontId::proportional(t.font_small), dim(t.form_dim)); + } + let corner = pos2(rect.right() - t.space_6, rect.top() + t.space_6); + if tile { + // The checkbox in the corner: 15 points, radius 4, accent with a tick when on. + let size = t.space_14 + 1.0; + let box_rect = Rect::from_min_size(corner - vec2(size, 0.0), vec2(size, size)); + if card.selected { + p.rect_filled(box_rect, t.space_4, dim(t.form_primary)); + tick(p, box_rect, dim(t.on_accent)); + } else { + p.rect(box_rect, t.space_4, dim(t.control_fill), Stroke::new(1.0, dim(t.control_border)), StrokeKind::Inside); + } + } else if card.options.is_some() || card.check { + let size = t.space_16; + let centre = pos2(rect.right() - t.space_6 + 1.0 - size * 0.5, rect.top() + t.space_6 - 1.0 + size * 0.5); + p.circle_filled(centre, size * 0.5, dim(t.form_primary)); + if card.check { + tick(p, Rect::from_center_size(centre, vec2(size, size) * 0.75), dim(t.on_accent)); + } else { + let dot = Rect::from_center_size(centre, vec2(size, size) * 0.6); + crate::icons::paint_ink(p, dot, "settings", dim(t.on_accent)); + } + } + let kind = if tile { egui::WidgetType::Checkbox } else { egui::WidgetType::RadioButton }; + response.widget_info(|| egui::WidgetInfo::selected(kind, enabled, card.selected, card.label)); + scenario::publish_target(&format!("prefs:card:{}", card.label), rect); + let response = if let Some(options) = card.options { response.on_hover_text(options) } else { response }; + if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response } +} + +fn tick(p: &Painter, r: Rect, ink: Color32) { + let w = (r.width() * 0.16).max(1.0); + let a = pos2(r.left() + r.width() * 0.24, r.top() + r.height() * 0.52); + let b = pos2(r.left() + r.width() * 0.42, r.top() + r.height() * 0.70); + let c = pos2(r.left() + r.width() * 0.78, r.top() + r.height() * 0.32); + p.line_segment([a, b], Stroke::new(w, ink)); + p.line_segment([b, c], Stroke::new(w, ink)); +} + +/// A radio card: a figure, a label and an optional sub-label. Click it to choose it. +pub(crate) fn picture_card(ui: &mut Ui, card: &Card, width: f32) -> Response { + paint_card(ui, card, width, false) +} + +/// A toggle tile: the same picture with a checkbox in the corner. Click it to flip `card.selected`. +pub(crate) fn toggle_tile(ui: &mut Ui, card: &Card, width: f32) -> Response { + paint_card(ui, card, width, true) +} + +/// A preset card: an icon, a name, one word and a check. `icon` paints into the 38-point box in +/// the colour it is given. +pub(crate) fn preset_card( + ui: &mut Ui, + name: &str, + word: &str, + selected: bool, + enabled: bool, + icon: &dyn Fn(&Painter, Rect, Color32), + width: f32, +) -> Response { + let t = Tokens::get(); + let enabled = enabled && ui.is_enabled(); + let width = dimension(width); + let height = t.space_24 * 3.0 - t.space_2; + let (rect, response) = ui.allocate_exact_size(vec2(width, height), if enabled { Sense::click() } else { Sense::hover() }); + let look = card_look(selected, enabled, response.hovered(), response.has_focus()); + let dim = |c: Color32| c.gamma_multiply(look.alpha); + let p = ui.painter(); + let fill = match look.fill { + CardFill::Selected => t.selected_bg, + CardFill::Hover => t.hover, + CardFill::Face => t.control_fill, + }; + let radius = f32::from(t.radius_lg) + t.space_2; + p.rect(rect, radius, dim(fill), Stroke::new(look.border, dim(if selected { t.form_primary } else { t.dialog_border })), StrokeKind::Inside); + if look.focus_ring { + p.rect_stroke(rect.expand(t.space_2), radius + t.space_2, Stroke::new(t.space_2, t.form_primary), StrokeKind::Outside); + } + let box_size = t.space_24 + t.space_14; + let box_rect = Rect::from_min_size(pos2(rect.left() + t.space_14, rect.center().y - box_size * 0.5), vec2(box_size, box_size)); + let box_fill = if selected { t.form_primary } else { t.pref_well }; + let box_ink = if selected { t.on_accent } else { t.form_dim }; + p.rect_filled(box_rect, f32::from(t.radius_lg) + t.space_2, dim(box_fill)); + icon(p, Rect::from_center_size(box_rect.center(), box_rect.size() * 0.55), dim(box_ink)); + let text_left = box_rect.right() + t.space_12; + let text_width = (rect.right() - t.space_14 - t.space_24 - text_left).max(0.0); + let name_font = crate::fonts::semibold(t.font_heading.min(t.font_subtitle)); + let name_ink = if selected { t.selected_ink } else { t.form_ink }; + let name_rect = Rect::from_min_size(pos2(text_left, rect.center().y - t.space_16), vec2(text_width, t.space_16)); + super::text::paint_text(ui, name_rect, name, name_font, dim(name_ink), false); + let word_rect = Rect::from_min_size(pos2(text_left, name_rect.bottom()), vec2(text_width, t.space_16)); + super::text::paint_text(ui, word_rect, word, FontId::proportional(t.font_small), dim(t.form_dim), false); + let p = ui.painter(); + if selected { + let centre = pos2(rect.right() - t.space_14 - t.space_8 + 1.0, rect.center().y); + p.circle_filled(centre, t.space_8 + 1.0, dim(t.form_primary)); + tick(p, Rect::from_center_size(centre, vec2(t.space_12, t.space_12)), dim(t.on_accent)); + } + response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::RadioButton, enabled, selected, name)); + scenario::publish_target(&format!("prefs:preset:{name}"), rect); + if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response } +} + +/// The (i) icon after a label: shows `text` as a tooltip and tells assistive technology the same. +pub(crate) fn help_icon(ui: &mut Ui, text: &str) -> Response { + let t = Tokens::get(); + let size = t.space_12 + 1.0; + let (rect, response) = ui.allocate_exact_size(vec2(size, size), Sense::hover()); + let ink = if response.hovered() { t.form_ink } else { t.form_dim }; + let p = ui.painter(); + p.circle_stroke(rect.center(), size * 0.5 - 0.5, Stroke::new(1.0, ink)); + p.circle_filled(pos2(rect.center().x, rect.top() + size * 0.3), 0.9, ink); + p.line_segment([pos2(rect.center().x, rect.top() + size * 0.46), pos2(rect.center().x, rect.bottom() - size * 0.24)], Stroke::new(1.2, ink)); + response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), text)); + scenario::publish_target("prefs:help_icon", rect); + response.on_hover_text(text) +} + +/// Which items of a carousel are shown: the first one and how many fit between the two arrows. +pub(super) fn carousel_window(count: usize, offset: usize, available: f32, item_width: f32, gap: f32, arrow: f32) -> (usize, usize) { + if count == 0 { + return (0, 0); + } + let room = dimension(available) - 2.0 * (arrow + gap); + let unit = dimension(item_width).max(1.0) + gap.max(0.0); + let visible = (((room + gap) / unit).floor() as usize).clamp(1, count); + (offset.min(count - visible), visible) +} + +/// A row of items with a previous and a next arrow; an arrow is dimmed and inert at its end. +/// `item` paints the item at an index into a column `item_width` wide and `item_height` high. +pub(crate) fn carousel( + ui: &mut Ui, + id: impl std::hash::Hash + std::fmt::Debug, + count: usize, + item_width: f32, + item_height: f32, + mut item: impl FnMut(&mut Ui, usize), +) -> (usize, usize) { + let t = Tokens::get(); + let key = ui.make_persistent_id(id); + let gap = t.space_8; + let arrow = t.space_24 + 2.0; + let offset = ui.data(|d| d.get_temp::(key)).unwrap_or(0); + let (first, visible) = carousel_window(count, offset, ui.available_width(), item_width, gap, arrow); + let height = dimension(item_height); + let mut next_offset = first; + ui.horizontal_top(|ui| { + ui.spacing_mut().item_spacing.x = gap; + let can_back = first > 0; + if carousel_arrow(ui, vec2(arrow, height), -1.0, can_back, crate::i18n::tr("prefs.carousel_previous")).clicked() { + next_offset = first.saturating_sub(1); + } + for index in first..first + visible { + ui.allocate_ui_with_layout(vec2(dimension(item_width), height), egui::Layout::top_down(egui::Align::Min), |ui| { + ui.set_width(dimension(item_width)); + item(ui, index); + }); + } + let can_forward = first + visible < count; + if carousel_arrow(ui, vec2(arrow, height), 1.0, can_forward, crate::i18n::tr("prefs.carousel_next")).clicked() { + next_offset = (first + 1).min(count.saturating_sub(visible)); + } + }); + ui.data_mut(|d| d.insert_temp(key, next_offset)); + (first, visible) +} + +fn carousel_arrow(ui: &mut Ui, size: egui::Vec2, direction: f32, enabled: bool, label: &str) -> Response { + let t = Tokens::get(); + let (rect, response) = ui.allocate_exact_size(size, if enabled { Sense::click() } else { Sense::hover() }); + let alpha = if enabled { 1.0 } else { 0.35 }; + let p = ui.painter(); + let fill = if enabled && response.hovered() { t.hover } else { t.control_fill }; + p.rect(rect, f32::from(t.radius_lg), fill.gamma_multiply(alpha), Stroke::new(1.0, t.dialog_border.gamma_multiply(alpha)), StrokeKind::Inside); + let icon = Rect::from_center_size(rect.center(), vec2(t.space_16, t.space_16)); + let ink = t.form_ink.gamma_multiply(alpha); + if direction < 0.0 { + crate::icons::paint_ink_mirrored(p, icon, "chevron_right", ink); + } else { + crate::icons::paint_ink(p, icon, "chevron_right", ink); + } + if enabled && response.has_focus() { + p.rect_stroke(rect.expand(t.space_2), f32::from(t.radius_lg) + t.space_2, Stroke::new(t.space_2, t.form_primary), StrokeKind::Outside); + } + response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, enabled, label)); + scenario::publish_target(&format!("prefs:carousel:{label}"), rect); + if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response } +} diff --git a/crates/ui-egui/src/ui_kit/preferences_figure_data.rs b/crates/ui-egui/src/ui_kit/preferences_figure_data.rs new file mode 100644 index 000000000..313496bb7 --- /dev/null +++ b/crates/ui-egui/src/ui_kit/preferences_figure_data.rs @@ -0,0 +1,4580 @@ +//! Generated by `tools/preferences-figures/generate.py` from `docs/design/preferences/figures/*.svg`. +//! Do not edit by hand: change the SVG and run the script again. +#![allow(clippy::approx_constant, clippy::excessive_precision)] +use super::preferences_figure_ops::{Figure, G, Ink, L, Op, P}; + +pub(super) const AA_2X: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [108.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [84.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.25 }), line: None }, + Op::Rect { r: [90.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [96.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.25 }), line: None }, + Op::Rect { r: [78.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [84.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [66.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.25 }), line: None }, + Op::Rect { r: [48.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [54.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [36.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [42.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [24.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [6.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [12.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[6.0, 8.0], [6.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[12.0, 8.0], [12.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[18.0, 8.0], [18.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[24.0, 8.0], [24.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 8.0], [30.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[36.0, 8.0], [36.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 8.0], [42.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[48.0, 8.0], [48.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[54.0, 8.0], [54.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 8.0], [60.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.0, 8.0], [66.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 8.0], [72.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[78.0, 8.0], [78.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[84.0, 8.0], [84.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 8.0], [90.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[96.0, 8.0], [96.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[102.0, 8.0], [102.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[108.0, 8.0], [108.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[114.0, 8.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 8.0], [114.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 14.0], [114.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 20.0], [114.0, 20.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 26.0], [114.0, 26.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 32.0], [114.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 38.0], [114.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 44.0], [114.0, 44.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 50.0], [114.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 56.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const AA_4X: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.06 }), line: None }, + Op::Rect { r: [102.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.44 }), line: None }, + Op::Rect { r: [108.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.88 }), line: None }, + Op::Rect { r: [84.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.12 }), line: None }, + Op::Rect { r: [90.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.62 }), line: None }, + Op::Rect { r: [96.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.94 }), line: None }, + Op::Rect { r: [102.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.38 }), line: None }, + Op::Rect { r: [78.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [84.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.06 }), line: None }, + Op::Rect { r: [60.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.5 }), line: None }, + Op::Rect { r: [66.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.88 }), line: None }, + Op::Rect { r: [72.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.25 }), line: None }, + Op::Rect { r: [48.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.62 }), line: None }, + Op::Rect { r: [54.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.06 }), line: None }, + Op::Rect { r: [30.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.38 }), line: None }, + Op::Rect { r: [36.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.81 }), line: None }, + Op::Rect { r: [42.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.12 }), line: None }, + Op::Rect { r: [18.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.56 }), line: None }, + Op::Rect { r: [24.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.94 }), line: None }, + Op::Rect { r: [30.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [6.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.69 }), line: None }, + Op::Rect { r: [12.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[6.0, 8.0], [6.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[12.0, 8.0], [12.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[18.0, 8.0], [18.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[24.0, 8.0], [24.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 8.0], [30.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[36.0, 8.0], [36.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 8.0], [42.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[48.0, 8.0], [48.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[54.0, 8.0], [54.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 8.0], [60.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.0, 8.0], [66.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 8.0], [72.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[78.0, 8.0], [78.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[84.0, 8.0], [84.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 8.0], [90.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[96.0, 8.0], [96.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[102.0, 8.0], [102.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[108.0, 8.0], [108.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[114.0, 8.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 8.0], [114.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 14.0], [114.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 20.0], [114.0, 20.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 26.0], [114.0, 26.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 32.0], [114.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 38.0], [114.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 44.0], [114.0, 44.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 50.0], [114.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 56.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const AA_8X: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.06 }), line: None }, + Op::Rect { r: [102.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.42 }), line: None }, + Op::Rect { r: [108.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.84 }), line: None }, + Op::Rect { r: [84.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.17 }), line: None }, + Op::Rect { r: [90.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.59 }), line: None }, + Op::Rect { r: [96.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.95 }), line: None }, + Op::Rect { r: [102.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.02 }), line: None }, + Op::Rect { r: [72.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.33 }), line: None }, + Op::Rect { r: [78.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.75 }), line: None }, + Op::Rect { r: [84.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.09 }), line: None }, + Op::Rect { r: [60.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.48 }), line: None }, + Op::Rect { r: [66.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.89 }), line: None }, + Op::Rect { r: [72.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.22 }), line: None }, + Op::Rect { r: [48.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.66 }), line: None }, + Op::Rect { r: [54.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.98 }), line: None }, + Op::Rect { r: [60.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.03 }), line: None }, + Op::Rect { r: [30.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.39 }), line: None }, + Op::Rect { r: [36.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.81 }), line: None }, + Op::Rect { r: [42.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.14 }), line: None }, + Op::Rect { r: [18.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.55 }), line: None }, + Op::Rect { r: [24.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.94 }), line: None }, + Op::Rect { r: [30.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [6.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 0.7 }), line: None }, + Op::Rect { r: [12.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[6.0, 8.0], [6.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[12.0, 8.0], [12.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[18.0, 8.0], [18.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[24.0, 8.0], [24.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 8.0], [30.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[36.0, 8.0], [36.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 8.0], [42.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[48.0, 8.0], [48.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[54.0, 8.0], [54.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 8.0], [60.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.0, 8.0], [66.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 8.0], [72.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[78.0, 8.0], [78.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[84.0, 8.0], [84.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 8.0], [90.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[96.0, 8.0], [96.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[102.0, 8.0], [102.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[108.0, 8.0], [108.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[114.0, 8.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 8.0], [114.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 14.0], [114.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 20.0], [114.0, 20.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 26.0], [114.0, 26.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 32.0], [114.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 38.0], [114.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 44.0], [114.0, 44.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 50.0], [114.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 56.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 0.55 }), line: None }, + ], +}; + +pub(super) const AA_OFF: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 8.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 14.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 20.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 26.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 32.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 38.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 44.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [6.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [18.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [36.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [48.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [54.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [60.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [66.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [72.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [78.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [84.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [90.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [96.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [102.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [108.0, 50.0, 6.0, 6.0], radius: 0.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[6.0, 8.0], [6.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[12.0, 8.0], [12.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[18.0, 8.0], [18.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[24.0, 8.0], [24.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 8.0], [30.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[36.0, 8.0], [36.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 8.0], [42.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[48.0, 8.0], [48.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[54.0, 8.0], [54.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 8.0], [60.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.0, 8.0], [66.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 8.0], [72.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[78.0, 8.0], [78.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[84.0, 8.0], [84.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 8.0], [90.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[96.0, 8.0], [96.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[102.0, 8.0], [102.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[108.0, 8.0], [108.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[114.0, 8.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 8.0], [114.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 14.0], [114.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 20.0], [114.0, 20.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 26.0], [114.0, 26.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 32.0], [114.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 38.0], [114.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 44.0], [114.0, 44.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 50.0], [114.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 56.0], [114.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.14, w: 0.5, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const AGENT_POINTER_SPEED: Figure = Figure { + size: [230.0, 84.0], + ops: &[ + Op::Poly { + pts: &[[24.0, 48.0], [115.0, 42.0], [186.0, 36.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [3.0, 4.0], round: false }), + }, + Op::Circle { c: [24.0, 48.0, 3.0], fill: Some(P { ink: Ink::ControlBorder, a: 1.0 }), line: None }, + Op::Circle { c: [115.0, 42.0, 3.0], fill: Some(P { ink: Ink::ControlBorder, a: 1.0 }), line: None }, + Op::Circle { c: [186.0, 36.0, 3.0], fill: Some(P { ink: Ink::ControlBorder, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[115.0, 42.0], [118.0, 60.0], [123.0, 53.0], [130.0, 56.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Card, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const AO_ON: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[32.742, 27.5], [44.0, 34.0], [44.0, 47.0], [32.742, 40.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[55.258, 27.5], [44.0, 34.0], [44.0, 47.0], [55.258, 40.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 21.0], [55.258, 27.5], [44.0, 34.0], [32.742, 27.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[64.742, 27.5], [76.0, 34.0], [76.0, 47.0], [64.742, 40.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[87.258, 27.5], [76.0, 34.0], [76.0, 47.0], [87.258, 40.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[76.0, 21.0], [87.258, 27.5], [76.0, 34.0], [64.742, 27.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Glow { c: [60.0, 42.0, 22.0, 7.0], a: 0.55 }, + Op::Glow { c: [60.0, 31.0, 5.0, 10.0], a: 0.44 }, + ], +}; + +pub(super) const ASSEMBLY_MOVE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 32.0, 20.0], fill: None, line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }) }, + Op::Circle { c: [60.0, 32.0, 27.0], fill: None, line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }) }, + Op::Poly { + pts: &[[77.0, 32.0], [83.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[74.7, 40.5], [79.9, 43.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[68.5, 46.7], [71.5, 51.9]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 49.0], [60.0, 55.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[51.5, 46.7], [48.5, 51.9]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[45.3, 40.5], [40.1, 43.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[43.0, 32.0], [37.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[45.3, 23.5], [40.1, 20.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[51.5, 17.3], [48.5, 12.1]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 15.0], [60.0, 9.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[68.5, 17.3], [71.5, 12.1]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[74.7, 23.5], [79.9, 20.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [54.0, 26.0, 12.0, 12.0], + radius: 2.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [80.0, 32.0, 3.6], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Reference, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [80.0, 32.0, 1.4], fill: Some(P { ink: Ink::Reference, a: 1.0 }), line: None }, + ], +}; + +pub(super) const BROWSER_CARD: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 214.0, 92.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[100.01, 66.5], [113.0, 74.0], [113.0, 89.0], [100.01, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[125.99, 66.5], [113.0, 74.0], [113.0, 89.0], [125.99, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[113.0, 59.0], [125.99, 66.5], [113.0, 74.0], [100.01, 66.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [12.0, 32.0, 48.0, 62.0], + radius: 4.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 122.0, 214.0, 20.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [42.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [72.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [102.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [132.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [162.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + ], +}; + +pub(super) const BROWSER_COLUMN: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { + r: [64.0, 26.0, 156.0, 92.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[129.01, 66.5], [142.0, 74.0], [142.0, 89.0], [129.01, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[154.99, 66.5], [142.0, 74.0], [142.0, 89.0], [154.99, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.0, 59.0], [154.99, 66.5], [142.0, 74.0], [129.01, 66.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 122.0, 214.0, 20.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [42.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [72.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [102.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [132.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [162.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + ], +}; + +pub(super) const COLOUR_VISION_AXES: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[14.0, 34.0], [66.0, 34.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv2, a: 1.0, w: 3.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[14.0, 34.0], [14.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv0, a: 1.0, w: 3.0, dash: [0.0, 0.0], round: true }), + }, + ], +}; + +pub(super) const COLOUR_VISION_BENDS: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[10.0, 14.0], [74.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv1, a: 1.0, w: 2.4, dash: [6.0, 4.0], round: false }), + }, + Op::Poly { + pts: &[[10.0, 30.0], [74.0, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv3, a: 1.0, w: 2.4, dash: [6.0, 4.0], round: false }), + }, + ], +}; + +pub(super) const COLOUR_VISION_DRAFT: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { r: [8.0, 8.0, 22.0, 28.0], radius: 0.0, fill: Some(P { ink: Ink::Cv3, a: 1.0 }), line: None }, + Op::Rect { r: [30.0, 8.0, 22.0, 28.0], radius: 0.0, fill: Some(P { ink: Ink::Cv1, a: 1.0 }), line: None }, + Op::Clip(&[[52.0, 8.0], [76.0, 8.0], [76.0, 36.0], [52.0, 36.0]]), + Op::Rect { r: [52.0, 8.0, 24.0, 28.0], radius: 0.0, fill: Some(P { ink: Ink::Cv4, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[38.0, 36.0], [52.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 36.0], [58.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[50.0, 36.0], [64.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[56.0, 36.0], [70.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[62.0, 36.0], [76.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[68.0, 36.0], [82.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[74.0, 36.0], [88.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Black, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + ], +}; + +pub(super) const COLOUR_VISION_FAILED: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [14.0, 12.0, 56.0, 20.0], + radius: 4.0, + fill: Some(P { ink: Ink::NoteFill, a: 1.0 }), + line: Some(L { ink: Ink::Cv2, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[36.0, 17.0], [48.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv2, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[48.0, 17.0], [36.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv2, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + ], +}; + +pub(super) const COLOUR_VISION_FIXED: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[12.0, 22.0], [72.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv0, a: 1.0, w: 3.0, dash: [0.0, 0.0], round: true }), + }, + ], +}; + +pub(super) const COLOUR_VISION_PROJECTED: Figure = Figure { + size: [84.0, 44.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 84.0, 44.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[12.0, 22.0], [72.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Cv1, a: 1.0, w: 3.0, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { c: [12.0, 22.0, 2.2], fill: Some(P { ink: Ink::Cv1, a: 1.0 }), line: None }, + Op::Circle { c: [72.0, 22.0, 2.2], fill: Some(P { ink: Ink::Cv1, a: 1.0 }), line: None }, + ], +}; + +pub(super) const DIRECT_INTERACTION: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[31.0, 20.0], [44.0, 27.5], [44.0, 57.5], [31.0, 50.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[57.0, 20.0], [44.0, 27.5], [44.0, 57.5], [57.0, 50.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 12.5], [57.0, 20.0], [44.0, 27.5], [31.0, 20.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 12.5], [57.0, 20.0], [44.0, 27.5], [31.0, 20.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.4 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 30.5], [57.0, 38.0], [44.0, 45.5], [31.0, 38.0]], + closed: true, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.0, dash: [2.5, 2.5], round: false }), + }, + Op::Poly { + pts: &[[44.0, 34.0], [44.0, 13.1]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[44.0, 8.5], [46.8, 13.1], [41.2, 13.1]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: None, + }, + Op::Poly { + pts: &[[46.0, 18.0], [46.0, 31.5], [49.6, 28.26], [52.12, 34.2], [54.46, 33.12], [51.94, 27.36], [56.62, 27.18]], + closed: true, + fill: Some(P { ink: Ink::Text, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Ground, a: 1.0, w: 0.99, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [76.0, 14.0, 30.0, 14.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [91.0, 24.0], size: 6.5, anchor: 1, ink: Ink::Accent, a: 1.0, s: "+18 mm", bold: true }, + ], +}; + +pub(super) const FRAME_RATE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [26.0, 12.0, 68.0, 40.0], + radius: 6.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [60.0, 31.0], size: 10.0, anchor: 1, ink: Ink::Text, a: 1.0, s: "60 fps", bold: true }, + Op::Poly { + pts: &[ + [34.0, 39.0], + [39.0, 42.0], + [43.0, 42.0], + [48.0, 39.0], + [52.0, 42.0], + [57.0, 42.0], + [62.0, 39.0], + [66.0, 42.0], + [71.0, 42.0], + [75.0, 39.0], + [80.0, 42.0], + [85.0, 42.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.3, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const HISTORY_BOTTOM: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { + r: [64.0, 26.0, 156.0, 92.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[129.01, 66.5], [142.0, 74.0], [142.0, 89.0], [129.01, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[154.99, 66.5], [142.0, 74.0], [142.0, 89.0], [154.99, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.0, 59.0], [154.99, 66.5], [142.0, 74.0], [129.01, 66.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 122.0, 214.0, 20.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [42.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [72.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [102.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [132.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [162.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + ], +}; + +pub(super) const HISTORY_IN_BROWSER: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 118.0, 40.0, 16.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 0.25 }), line: None }, + Op::Rect { + r: [64.0, 26.0, 156.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[129.01, 78.5], [142.0, 86.0], [142.0, 101.0], [129.01, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[154.99, 78.5], [142.0, 86.0], [142.0, 101.0], [154.99, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.0, 71.0], [154.99, 78.5], [142.0, 86.0], [129.01, 78.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const HISTORY_LEFT: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { + r: [64.0, 26.0, 20.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [90.0, 26.0, 130.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.01, 78.5], [155.0, 86.0], [155.0, 101.0], [142.01, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[167.99, 78.5], [155.0, 86.0], [155.0, 101.0], [167.99, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[155.0, 71.0], [167.99, 78.5], [155.0, 86.0], [142.01, 78.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const HISTORY_UNDER_BROWSER: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 86.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { + r: [6.0, 116.0, 52.0, 26.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [64.0, 26.0, 156.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[129.01, 78.5], [142.0, 86.0], [142.0, 101.0], [129.01, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[154.99, 78.5], [142.0, 86.0], [142.0, 101.0], [154.99, 93.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.0, 71.0], [154.99, 78.5], [142.0, 86.0], [129.01, 78.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const LAYOUT_SCHEMATIC: Figure = Figure { + size: [226.0, 148.0], + ops: &[ + Op::Rect { + r: [0.5, 0.5, 225.0, 147.0], + radius: 7.0, + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Border, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 6.0, 214.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [11.0, 11.0, 26.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { r: [43.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { r: [71.0, 11.0, 22.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.5 }), line: None }, + Op::Rect { + r: [6.0, 26.0, 52.0, 116.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 34.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 43.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 52.0, 34.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { r: [12.0, 61.0, 26.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Dim, a: 0.45 }), line: None }, + Op::Rect { + r: [64.0, 26.0, 156.0, 92.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::ControlBorder, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[129.01, 66.5], [142.0, 74.0], [142.0, 89.0], [129.01, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[154.99, 66.5], [142.0, 74.0], [142.0, 89.0], [154.99, 81.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[142.0, 59.0], [154.99, 66.5], [142.0, 74.0], [129.01, 66.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [6.0, 122.0, 214.0, 20.0], + radius: 3.0, + fill: Some(P { ink: Ink::Card, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [12.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [42.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [72.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [102.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [132.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + Op::Rect { r: [162.0, 129.0, 22.0, 7.0], radius: 2.0, fill: Some(P { ink: Ink::Dim, a: 0.4 }), line: None }, + ], +}; + +pub(super) const MEASURE_AXIS_DISTANCES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [20.0, 22.0, 46.0, 28.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[20.0, 14.0], [66.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[20.0, 10.0], [20.0, 18.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.0, 10.0], [66.0, 18.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [43.0, 9.0], size: 7.0, anchor: 1, ink: Ink::Accent, a: 1.0, s: "X 46", bold: true }, + Op::Poly { + pts: &[[76.0, 22.0], [76.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 22.0], [80.0, 22.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.0, 50.0], [80.0, 50.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [98.0, 39.0], size: 7.0, anchor: 1, ink: Ink::Accent, a: 1.0, s: "Y 28", bold: true }, + ], +}; + +pub(super) const MOUSE_MAPPING: Figure = Figure { + size: [96.0, 120.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 96.0, 120.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [26.0, 14.0, 44.0, 86.0], + radius: 22.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[26.0, 56.0], [70.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[48.0, 14.0], [48.0, 56.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { r: [43.0, 24.0, 10.0, 20.0], radius: 5.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Poly { + pts: &[ + [26.0, 56.0], + [25.538, 54.028], + [25.259, 52.023], + [25.166, 50.0], + [25.259, 47.977], + [25.538, 45.972], + [26.0, 44.0], + [26.0, 36.0], + [26.423, 31.708], + [27.675, 27.581], + [29.708, 23.777], + [32.444, 20.444], + [35.777, 17.708], + [39.581, 15.675], + [43.708, 14.423], + [48.0, 14.0], + [48.0, 56.0], + ], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.0 }), + grad: None, + line: None, + }, + Op::Text { at: [36.0, 44.0], size: 8.0, anchor: 1, ink: Ink::Dim, a: 1.0, s: "L", bold: true }, + Op::Text { at: [60.0, 44.0], size: 8.0, anchor: 1, ink: Ink::Dim, a: 1.0, s: "R", bold: true }, + Op::Text { at: [48.0, 20.0], size: 7.0, anchor: 1, ink: Ink::Accent, a: 1.0, s: "M", bold: true }, + ], +}; + +pub(super) const NAVIGATOR_AXES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Circle { + c: [60.0, 32.0, 30.0], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 32.0, 26.0], fill: None, line: Some(L { ink: Ink::Line, a: 0.6, w: 0.6, dash: [1.5, 3.0], round: false }) }, + Op::Poly { + pts: &[[60.0, 32.0], [76.0, 22.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisY, a: 0.55, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[60.0, 32.0], [44.0, 22.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisX, a: 0.55, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[60.0, 32.0], [60.0, 50.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisZ, a: 0.55, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[60.0, 32.0], [44.0, 41.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisY, a: 1.0, w: 3.4, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[60.0, 32.0], [76.0, 41.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisX, a: 1.0, w: 3.4, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[60.0, 32.0], [60.0, 13.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisZ, a: 1.0, w: 3.4, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { c: [60.0, 32.0, 3.2], fill: Some(P { ink: Ink::Dim, a: 1.0 }), line: None }, + Op::Circle { + c: [60.0, 13.5, 8.2], + fill: Some(P { ink: Ink::AxisZ, a: 1.0 }), + line: Some(L { ink: Ink::AxisZ, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [60.0, 17.0], size: 10.0, anchor: 1, ink: Ink::White, a: 1.0, s: "Z", bold: true }, + Op::Circle { + c: [76.0, 41.2, 8.2], + fill: Some(P { ink: Ink::AxisX, a: 1.0 }), + line: Some(L { ink: Ink::AxisX, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [76.0, 44.8], size: 10.0, anchor: 1, ink: Ink::White, a: 1.0, s: "X", bold: true }, + Op::Circle { + c: [44.0, 41.2, 8.2], + fill: Some(P { ink: Ink::AxisY, a: 1.0 }), + line: Some(L { ink: Ink::AxisY, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [44.0, 44.8], size: 10.0, anchor: 1, ink: Ink::White, a: 1.0, s: "Y", bold: true }, + Op::Circle { + c: [60.0, 50.5, 5.6], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::AxisZ, a: 1.0, w: 2.2, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [44.0, 22.8, 5.6], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::AxisX, a: 1.0, w: 2.2, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [76.0, 22.8, 5.6], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::AxisY, a: 1.0, w: 2.2, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const NAVIGATOR_CUBE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Poly { + pts: &[ + [82.2, 60.0], + [81.773, 60.624], + [80.51, 61.225], + [78.459, 61.778], + [75.698, 62.263], + [72.334, 62.661], + [68.496, 62.956], + [64.331, 63.139], + [60.0, 63.2], + [55.669, 63.139], + [51.504, 62.956], + [47.666, 62.661], + [44.302, 62.263], + [41.541, 61.778], + [39.49, 61.225], + [38.227, 60.624], + [37.8, 60.0], + [38.227, 59.376], + [39.49, 58.775], + [41.541, 58.222], + [44.302, 57.737], + [47.666, 57.339], + [51.504, 57.044], + [55.669, 56.861], + [60.0, 56.8], + [64.331, 56.861], + [68.496, 57.044], + [72.334, 57.339], + [75.698, 57.737], + [78.459, 58.222], + [80.51, 58.775], + [81.773, 59.376], + ], + closed: true, + fill: Some(P { ink: Ink::Black, a: 0.12 }), + grad: None, + line: None, + }, + Op::Poly { + pts: &[[36.618, 18.5], [60.0, 32.0], [60.0, 59.0], [36.618, 45.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[83.382, 18.5], [60.0, 32.0], [60.0, 59.0], [83.382, 45.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 5.0], [83.382, 18.5], [60.0, 32.0], [36.618, 18.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 5.0], [83.382, 18.5], [60.0, 32.0], [36.618, 18.5]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 10.0], [75.4, 29.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::White, a: 0.5, w: 1.0, dash: [0.0, 0.0], round: true }), + }, + Op::Text { at: [57.402, 20.0], size: 8.375, anchor: 1, ink: Ink::Text, a: 1.0, s: "TOP", bold: true }, + Op::Text { at: [48.309, 41.15], size: 6.8, anchor: 1, ink: Ink::Text, a: 1.0, s: "FRONT", bold: true }, + Op::Text { at: [71.691, 41.15], size: 6.8, anchor: 1, ink: Ink::Text, a: 1.0, s: "RIGHT", bold: true }, + ], +}; + +pub(super) const ORBIT_CENTRE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [8.0, 5.0, 104.0, 54.0], + radius: 5.0, + fill: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 5.0], [60.0, 11.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 53.0], [60.0, 59.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[8.0, 32.0], [14.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[106.0, 32.0], [112.0, 32.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [28.0, 32.0], + [28.615, 30.244], + [30.436, 28.556], + [33.393, 27.0], + [37.373, 25.636], + [42.222, 24.517], + [47.754, 23.685], + [53.757, 23.173], + [60.0, 23.0], + [66.243, 23.173], + [72.246, 23.685], + [77.778, 24.517], + [82.627, 25.636], + [86.607, 27.0], + [89.564, 28.556], + [91.385, 30.244], + [92.0, 32.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.6, w: 1.2, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[28.144, 25.0], [42.0, 33.0], [42.0, 49.0], [28.144, 41.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[55.856, 25.0], [42.0, 33.0], [42.0, 49.0], [55.856, 41.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 17.0], [55.856, 25.0], [42.0, 33.0], [28.144, 25.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [28.0, 32.0], + [28.615, 33.756], + [30.436, 35.444], + [33.393, 37.0], + [37.373, 38.364], + [42.222, 39.483], + [47.754, 40.315], + [53.757, 40.827], + [60.0, 41.0], + [66.243, 40.827], + [72.246, 40.315], + [77.778, 39.483], + [82.627, 38.364], + [86.607, 37.0], + [89.564, 35.444], + [91.385, 33.756], + [92.0, 32.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[92.0, 26.5], [88.6, 32.8], [95.4, 32.8]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: None, + }, + Op::Circle { + c: [60.0, 32.0, 3.8], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Reference, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 32.0, 1.4], fill: Some(P { ink: Ink::Reference, a: 1.0 }), line: None }, + ], +}; + +pub(super) const ORBIT_CURSOR: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[ + [37.0, 29.0], + [37.615, 27.244], + [39.436, 25.556], + [42.393, 24.0], + [46.373, 22.636], + [51.222, 21.517], + [56.754, 20.685], + [62.757, 20.173], + [69.0, 20.0], + [75.243, 20.173], + [81.246, 20.685], + [86.778, 21.517], + [91.627, 22.636], + [95.607, 24.0], + [98.564, 25.556], + [100.385, 27.244], + [101.0, 29.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.6, w: 1.2, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[38.144, 24.0], [52.0, 32.0], [52.0, 48.0], [38.144, 40.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[65.856, 24.0], [52.0, 32.0], [52.0, 48.0], [65.856, 40.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[52.0, 16.0], [65.856, 24.0], [52.0, 32.0], [38.144, 24.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [37.0, 29.0], + [37.615, 30.756], + [39.436, 32.444], + [42.393, 34.0], + [46.373, 35.364], + [51.222, 36.483], + [56.754, 37.315], + [62.757, 37.827], + [69.0, 38.0], + [75.243, 37.827], + [81.246, 37.315], + [86.778, 36.483], + [91.627, 35.364], + [95.607, 34.0], + [98.564, 32.444], + [100.385, 30.756], + [101.0, 29.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[101.0, 23.5], [97.6, 29.8], [104.4, 29.8]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: None, + }, + Op::Circle { + c: [69.0, 29.0, 3.8], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Reference, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [69.0, 29.0, 1.4], fill: Some(P { ink: Ink::Reference, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[70.5, 30.5], [70.5, 45.5], [74.5, 41.9], [77.3, 48.5], [79.9, 47.3], [77.1, 40.9], [82.3, 40.7]], + closed: true, + fill: Some(P { ink: Ink::Text, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const ORBIT_ORIGIN: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[60.0, 21.0], [94.0, 38.0], [60.0, 55.0], [26.0, 38.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 0.35 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[ + [28.0, 38.0], + [28.615, 36.244], + [30.436, 34.556], + [33.393, 33.0], + [37.373, 31.636], + [42.222, 30.517], + [47.754, 29.685], + [53.757, 29.173], + [60.0, 29.0], + [66.243, 29.173], + [72.246, 29.685], + [77.778, 30.517], + [82.627, 31.636], + [86.607, 33.0], + [89.564, 34.556], + [91.385, 36.244], + [92.0, 38.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.6, w: 1.2, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[46.144, 22.0], [60.0, 30.0], [60.0, 46.0], [46.144, 38.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[73.856, 22.0], [60.0, 30.0], [60.0, 46.0], [73.856, 38.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 14.0], [73.856, 22.0], [60.0, 30.0], [46.144, 22.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [28.0, 38.0], + [28.615, 39.756], + [30.436, 41.444], + [33.393, 43.0], + [37.373, 44.364], + [42.222, 45.483], + [47.754, 46.315], + [53.757, 46.827], + [60.0, 47.0], + [66.243, 46.827], + [72.246, 46.315], + [77.778, 45.483], + [82.627, 44.364], + [86.607, 43.0], + [89.564, 41.444], + [91.385, 39.756], + [92.0, 38.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[92.0, 32.5], [88.6, 38.8], [95.4, 38.8]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: None, + }, + Op::Circle { + c: [60.0, 38.0, 3.8], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Reference, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 38.0, 1.4], fill: Some(P { ink: Ink::Reference, a: 1.0 }), line: None }, + ], +}; + +pub(super) const QUICK_MEASURE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[34.742, 29.5], [46.0, 36.0], [46.0, 49.0], [34.742, 42.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[57.258, 29.5], [46.0, 36.0], [46.0, 49.0], [57.258, 42.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[46.0, 23.0], [57.258, 29.5], [46.0, 36.0], [34.742, 29.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 22.0], [75.0, 13.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 22.0, 1.8], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [75.0, 13.5, 1.8], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Rect { + r: [78.0, 22.0, 34.0, 15.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [95.0, 32.5], size: 7.5, anchor: 1, ink: Ink::Accent, a: 1.0, s: "12.5 mm", bold: true }, + ], +}; + +pub(super) const SELECT_BODIES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[44.412, 25.0], [60.0, 34.0], [60.0, 52.0], [44.412, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.412, 25.0], [60.0, 34.0], [60.0, 52.0], [44.412, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[75.588, 25.0], [60.0, 34.0], [60.0, 52.0], [75.588, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[75.588, 25.0], [60.0, 34.0], [60.0, 52.0], [75.588, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [75.588, 25.0], [60.0, 34.0], [44.412, 25.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [75.588, 25.0], [60.0, 34.0], [44.412, 25.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const SELECT_FACES_EDGES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[44.412, 25.0], [60.0, 34.0], [60.0, 52.0], [44.412, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[75.588, 25.0], [60.0, 34.0], [60.0, 52.0], [75.588, 43.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [75.588, 25.0], [60.0, 34.0], [44.412, 25.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [75.588, 25.0], [60.0, 34.0], [44.412, 25.0]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const SKETCH_CONFLICT: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[ + [14.0, 46.0], + [18.637, 39.672], + [23.531, 34.188], + [28.66, 29.547], + [34.0, 25.75], + [39.527, 22.797], + [45.219, 20.688], + [51.051, 19.422], + [57.0, 19.0], + [63.043, 19.422], + [69.156, 20.688], + [75.316, 22.797], + [81.5, 25.75], + [87.684, 29.547], + [93.844, 34.188], + [99.957, 39.672], + [106.0, 46.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Note, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[14.0, 16.0], [106.0, 46.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Note, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [60.0, 31.0, 4.0], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Note, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[14.0, 54.0], [106.0, 54.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [3.0, 3.0], round: false }), + }, + ], +}; + +pub(super) const SKETCH_EXIT_KEEP: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [7.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[7.0, 12.0], [37.0, 12.0], [37.0, 42.0], [7.0, 42.0]]), + Op::Poly { + pts: &[[15.505, 24.25], [22.0, 28.0], [22.0, 35.5], [15.505, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[28.495, 24.25], [22.0, 28.0], [22.0, 35.5], [28.495, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[22.0, 20.5], [28.495, 24.25], [22.0, 28.0], [15.505, 24.25]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + Op::Rect { + r: [45.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[45.0, 12.0], [75.0, 12.0], [75.0, 42.0], [45.0, 42.0]]), + Op::Rect { + r: [53.0, 20.0, 14.0, 14.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[49.0, 27.0], [71.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [60.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Unclip, + Op::Poly { + pts: &[[37.5, 24.0], [41.5, 27.0], [37.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[75.5, 24.0], [79.5, 27.0], [75.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Rect { + r: [83.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[83.0, 12.0], [113.0, 12.0], [113.0, 42.0], [83.0, 42.0]]), + Op::Rect { + r: [91.0, 20.0, 14.0, 14.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[87.0, 27.0], [109.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Poly { + pts: &[[98.0, 16.0], [98.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Unclip, + Op::Text { at: [22.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "before", bold: false }, + Op::Text { at: [60.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "sketch", bold: false }, + Op::Text { at: [98.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Accent, a: 1.0, s: "after", bold: true }, + ], +}; + +pub(super) const SKETCH_EXIT_PREVIOUS: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [7.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[7.0, 12.0], [37.0, 12.0], [37.0, 42.0], [7.0, 42.0]]), + Op::Poly { + pts: &[[15.505, 24.25], [22.0, 28.0], [22.0, 35.5], [15.505, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[28.495, 24.25], [22.0, 28.0], [22.0, 35.5], [28.495, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[22.0, 20.5], [28.495, 24.25], [22.0, 28.0], [15.505, 24.25]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + Op::Rect { + r: [45.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[45.0, 12.0], [75.0, 12.0], [75.0, 42.0], [45.0, 42.0]]), + Op::Rect { + r: [53.0, 20.0, 14.0, 14.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[49.0, 27.0], [71.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [60.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Unclip, + Op::Poly { + pts: &[[37.5, 24.0], [41.5, 27.0], [37.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[75.5, 24.0], [79.5, 27.0], [75.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Rect { + r: [83.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[83.0, 12.0], [113.0, 12.0], [113.0, 42.0], [83.0, 42.0]]), + Op::Poly { + pts: &[[91.505, 24.25], [98.0, 28.0], [98.0, 35.5], [91.505, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[104.495, 24.25], [98.0, 28.0], [98.0, 35.5], [104.495, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[98.0, 20.5], [104.495, 24.25], [98.0, 28.0], [91.505, 24.25]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + Op::Text { at: [22.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "before", bold: false }, + Op::Text { at: [60.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "sketch", bold: false }, + Op::Text { at: [98.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Accent, a: 1.0, s: "after", bold: true }, + ], +}; + +pub(super) const SKETCH_EXIT_UNLESS_TURNED: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [7.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[7.0, 12.0], [37.0, 12.0], [37.0, 42.0], [7.0, 42.0]]), + Op::Poly { + pts: &[[15.505, 24.25], [22.0, 28.0], [22.0, 35.5], [15.505, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[28.495, 24.25], [22.0, 28.0], [22.0, 35.5], [28.495, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[22.0, 20.5], [28.495, 24.25], [22.0, 28.0], [15.505, 24.25]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + Op::Rect { + r: [45.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: Some(P { ink: Ink::Top, a: 0.45 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Clip(&[[45.0, 12.0], [75.0, 12.0], [75.0, 42.0], [45.0, 42.0]]), + Op::Rect { + r: [53.0, 20.0, 14.0, 14.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[49.0, 27.0], [71.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Poly { + pts: &[[60.0, 16.0], [60.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Unclip, + Op::Poly { + pts: &[[37.5, 24.0], [41.5, 27.0], [37.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[75.5, 24.0], [79.5, 27.0], [75.5, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: true }), + }, + Op::Rect { r: [83.0, 12.0, 30.0, 30.0], radius: 4.0, fill: Some(P { ink: Ink::Top, a: 0.45 }), line: None }, + Op::Clip(&[[83.0, 12.0], [113.0, 12.0], [113.0, 42.0], [83.0, 42.0]]), + Op::Clip(&[[83.0, 12.0], [113.0, 12.0], [83.0, 42.0]]), + Op::Poly { + pts: &[[91.505, 24.25], [98.0, 28.0], [98.0, 35.5], [91.505, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[104.495, 24.25], [98.0, 28.0], [98.0, 35.5], [104.495, 31.75]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[98.0, 20.5], [104.495, 24.25], [98.0, 28.0], [91.505, 24.25]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Unclip, + Op::Clip(&[[113.0, 12.0], [113.0, 42.0], [83.0, 42.0]]), + Op::Rect { + r: [91.0, 20.0, 14.0, 14.0], + radius: 0.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[87.0, 27.0], [109.0, 27.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Poly { + pts: &[[98.0, 16.0], [98.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.6, dash: [1.5, 1.5], round: false }), + }, + Op::Unclip, + Op::Poly { + pts: &[[113.0, 12.0], [83.0, 42.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [2.0, 2.0], round: false }), + }, + Op::Unclip, + Op::Rect { + r: [83.0, 12.0, 30.0, 30.0], + radius: 4.0, + fill: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [22.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "before", bold: false }, + Op::Text { at: [60.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Dim, a: 1.0, s: "sketch", bold: false }, + Op::Text { at: [98.0, 55.0], size: 6.5, anchor: 1, ink: Ink::Accent, a: 1.0, s: "after", bold: true }, + ], +}; + +pub(super) const SKETCH_GUIDES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [20.0, 16.0, 44.0, 30.0], + radius: 0.0, + fill: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.2, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 6.0], [42.0, 58.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[6.0, 31.0], [114.0, 31.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Circle { c: [42.0, 31.0, 3.0], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { + c: [90.0, 31.0, 3.4], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 24.0], [90.0, 38.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[83.0, 31.0], [97.0, 31.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const SKETCH_HIDE_GLYPHS: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[12.0, 44.0], [108.0, 44.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [18.0, 20.0, 14.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [42.0, 12.0, 14.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 0.8 }), + line: Some(L { ink: Ink::Line, a: 0.8, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [66.0, 20.0, 14.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 0.6 }), + line: Some(L { ink: Ink::Line, a: 0.6, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Rect { + r: [90.0, 12.0, 14.0, 14.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 0.4 }), + line: Some(L { ink: Ink::Line, a: 0.4, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const SKETCH_STATE_ICONS: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [13.0, 21.0, 22.0, 22.0], + radius: 5.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Ok, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [18.0, 38.0], + [19.0, 35.5], + [20.0, 33.333], + [21.0, 31.5], + [22.0, 30.0], + [23.0, 28.833], + [24.0, 28.0], + [25.0, 27.5], + [26.0, 27.333], + [27.0, 27.5], + [28.0, 28.0], + [29.0, 28.833], + [30.0, 30.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Ok, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { c: [30.0, 30.0, 1.8], fill: Some(P { ink: Ink::Ok, a: 1.0 }), line: None }, + Op::Rect { + r: [49.0, 21.0, 22.0, 22.0], + radius: 5.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Warn, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [54.0, 38.0], + [55.0, 35.5], + [56.0, 33.333], + [57.0, 31.5], + [58.0, 30.0], + [59.0, 28.833], + [60.0, 28.0], + [61.0, 27.5], + [62.0, 27.333], + [63.0, 27.5], + [64.0, 28.0], + [65.0, 28.833], + [66.0, 30.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Warn, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { c: [66.0, 30.0, 1.8], fill: Some(P { ink: Ink::Warn, a: 1.0 }), line: None }, + Op::Rect { + r: [85.0, 21.0, 22.0, 22.0], + radius: 5.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Note, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[ + [90.0, 38.0], + [91.0, 35.5], + [92.0, 33.333], + [93.0, 31.5], + [94.0, 30.0], + [95.0, 28.833], + [96.0, 28.0], + [97.0, 27.5], + [98.0, 27.333], + [99.0, 27.5], + [100.0, 28.0], + [101.0, 28.833], + [102.0, 30.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Note, a: 1.0, w: 1.8, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { c: [102.0, 30.0, 1.8], fill: Some(P { ink: Ink::Note, a: 1.0 }), line: None }, + ], +}; + +pub(super) const TESS_COARSE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 32.0, 21.0], fill: None, line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.9, dash: [2.0, 2.5], round: false }) }, + Op::Poly { + pts: &[[60.0, 11.0], [74.8, 17.2], [81.0, 32.0], [74.8, 46.8], [60.0, 53.0], [45.2, 46.8], [39.0, 32.0], [45.2, 17.2]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 11.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [74.8, 17.2, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [81.0, 32.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [74.8, 46.8, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 53.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [45.2, 46.8, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [39.0, 32.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [45.2, 17.2, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Text { at: [112.0, 60.0], size: 7.0, anchor: 2, ink: Ink::Dim, a: 1.0, s: "8", bold: false }, + ], +}; + +pub(super) const TESS_FINE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 32.0, 21.0], fill: None, line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.9, dash: [2.0, 2.5], round: false }) }, + Op::Poly { + pts: &[ + [60.0, 11.0], + [64.1, 11.4], + [68.0, 12.6], + [71.7, 14.5], + [74.8, 17.2], + [77.5, 20.3], + [79.4, 24.0], + [80.6, 27.9], + [81.0, 32.0], + [80.6, 36.1], + [79.4, 40.0], + [77.5, 43.7], + [74.8, 46.8], + [71.7, 49.5], + [68.0, 51.4], + [64.1, 52.6], + [60.0, 53.0], + [55.9, 52.6], + [52.0, 51.4], + [48.3, 49.5], + [45.2, 46.8], + [42.5, 43.7], + [40.6, 40.0], + [39.4, 36.1], + [39.0, 32.0], + [39.4, 27.9], + [40.6, 24.0], + [42.5, 20.3], + [45.2, 17.2], + [48.3, 14.5], + [52.0, 12.6], + [55.9, 11.4], + ], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [112.0, 60.0], size: 7.0, anchor: 2, ink: Ink::Dim, a: 1.0, s: "32", bold: false }, + ], +}; + +pub(super) const TESS_NORMAL: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 32.0, 21.0], fill: None, line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.9, dash: [2.0, 2.5], round: false }) }, + Op::Poly { + pts: &[ + [60.0, 11.0], + [68.0, 12.6], + [74.8, 17.2], + [79.4, 24.0], + [81.0, 32.0], + [79.4, 40.0], + [74.8, 46.8], + [68.0, 51.4], + [60.0, 53.0], + [52.0, 51.4], + [45.2, 46.8], + [40.6, 40.0], + [39.0, 32.0], + [40.6, 24.0], + [45.2, 17.2], + [52.0, 12.6], + ], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 11.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [68.0, 12.6, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [74.8, 17.2, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [79.4, 24.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [81.0, 32.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [79.4, 40.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [74.8, 46.8, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [68.0, 51.4, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 53.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [52.0, 51.4, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [45.2, 46.8, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [40.6, 40.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [39.0, 32.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [40.6, 24.0, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [45.2, 17.2, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [52.0, 12.6, 1.7], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Text { at: [112.0, 60.0], size: 7.0, anchor: 2, ink: Ink::Dim, a: 1.0, s: "16", bold: false }, + ], +}; + +pub(super) const TESS_ULTRA: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 32.0, 21.0], fill: None, line: Some(L { ink: Ink::Dim, a: 1.0, w: 0.9, dash: [2.0, 2.5], round: false }) }, + Op::Poly { + pts: &[ + [60.0, 11.0], + [62.1, 11.1], + [64.1, 11.4], + [66.1, 11.9], + [68.0, 12.6], + [69.9, 13.5], + [71.7, 14.5], + [73.3, 15.8], + [74.8, 17.2], + [76.2, 18.7], + [77.5, 20.3], + [78.5, 22.1], + [79.4, 24.0], + [80.1, 25.9], + [80.6, 27.9], + [80.9, 29.9], + [81.0, 32.0], + [80.9, 34.1], + [80.6, 36.1], + [80.1, 38.1], + [79.4, 40.0], + [78.5, 41.9], + [77.5, 43.7], + [76.2, 45.3], + [74.8, 46.8], + [73.3, 48.2], + [71.7, 49.5], + [69.9, 50.5], + [68.0, 51.4], + [66.1, 52.1], + [64.1, 52.6], + [62.1, 52.9], + [60.0, 53.0], + [57.9, 52.9], + [55.9, 52.6], + [53.9, 52.1], + [52.0, 51.4], + [50.1, 50.5], + [48.3, 49.5], + [46.7, 48.2], + [45.2, 46.8], + [43.8, 45.3], + [42.5, 43.7], + [41.5, 41.9], + [40.6, 40.0], + [39.9, 38.1], + [39.4, 36.1], + [39.1, 34.1], + [39.0, 32.0], + [39.1, 29.9], + [39.4, 27.9], + [39.9, 25.9], + [40.6, 24.0], + [41.5, 22.1], + [42.5, 20.3], + [43.8, 18.7], + [45.2, 17.2], + [46.7, 15.8], + [48.3, 14.5], + [50.1, 13.5], + [52.0, 12.6], + [53.9, 11.9], + [55.9, 11.4], + [57.9, 11.1], + ], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Text { at: [112.0, 60.0], size: 7.0, anchor: 2, ink: Ink::Dim, a: 1.0, s: "64", bold: false }, + ], +}; + +pub(super) const TOOL_CURSOR: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[10.0, 46.0], [13.4, 42.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.028, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[13.4, 42.8], [16.8, 39.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.083, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[16.8, 39.6], [20.2, 36.4]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.138, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[20.2, 36.4], [23.6, 33.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.193, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[23.6, 33.2], [27.0, 30.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.248, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[27.0, 30.0], [30.4, 26.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.303, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[30.4, 26.8], [33.8, 23.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.357, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[33.8, 23.6], [37.2, 20.4]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.413, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[37.2, 20.4], [40.6, 17.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.468, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[40.6, 17.2], [44.0, 14.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.522, w: 2.2, dash: [0.0, 0.0], round: true }), + }, + Op::Rect { + r: [55.5, 28.0, 22.0, 22.0], + radius: 6.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[61.0, 44.5], [72.0, 33.5]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Circle { + c: [61.0, 44.5, 2.0], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [72.0, 33.5, 2.0], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[43.5, 13.5], [43.5, 33.0], [48.7, 28.32], [52.34, 36.9], [55.72, 35.34], [52.08, 27.02], [58.84, 26.76]], + closed: true, + fill: Some(P { ink: Ink::Text, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.43, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const TOOL_EXTRUDE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [20.0, 40.0, 40.0, 14.0], + radius: 2.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[40.0, 38.0], [40.0, 18.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[40.0, 14.0], [42.5, 18.2], [37.5, 18.2]], + closed: true, + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + grad: None, + line: None, + }, + Op::Poly { + pts: &[[12.0, 10.0], [108.0, 10.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Rect { + r: [76.0, 6.0, 28.0, 8.0], + radius: 0.0, + fill: Some(P { ink: Ink::Accent, a: 0.38 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const TOOL_HOLE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [26.0, 8.0, 68.0, 48.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [60.0, 32.0, 10.0], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.6, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 32.0, 2.3], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [26.0, 32.0, 2.3], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [94.0, 32.0, 2.3], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 8.0, 2.3], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + Op::Circle { c: [60.0, 56.0, 2.3], fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + ], +}; + +pub(super) const TOOL_PLACEMENT: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Rect { + r: [22.0, 10.0, 76.0, 44.0], + radius: 3.0, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 32.0, 13.0], fill: None, line: Some(L { ink: Ink::Accent, a: 1.0, w: 1.0, dash: [3.0, 3.0], round: false }) }, + Op::Poly { + pts: &[ + [60.0, 19.0], + [62.536, 19.25], + [64.975, 19.99], + [67.222, 21.191], + [69.192, 22.808], + [70.809, 24.778], + [72.01, 27.025], + [72.75, 29.464], + [73.0, 32.0], + ], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 1.0, w: 2.4, dash: [0.0, 0.0], round: true }), + }, + Op::Rect { r: [55.0, 27.0, 10.0, 10.0], radius: 2.0, fill: Some(P { ink: Ink::Accent, a: 1.0 }), line: None }, + ], +}; + +pub(super) const VERTEX_MARKERS: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[46.144, 26.0], [60.0, 34.0], [60.0, 50.0], [46.144, 42.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[73.856, 26.0], [60.0, 34.0], [60.0, 50.0], [73.856, 42.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 18.0], [73.856, 26.0], [60.0, 34.0], [46.144, 26.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [60.0, 18.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [73.9, 26.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [73.9, 42.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [60.0, 50.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [46.1, 42.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [46.1, 26.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { + c: [60.0, 34.0, 2.4], + fill: Some(P { ink: Ink::Accent, a: 1.0 }), + line: Some(L { ink: Ink::Ground, a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const VIEW_ANGLES: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[38.0, 44.0], [38.0, 28.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisZ, a: 1.0, w: 2.0, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[38.0, 24.0], [40.8, 28.6], [35.2, 28.6]], + closed: true, + fill: Some(P { ink: Ink::AxisZ, a: 1.0 }), + grad: None, + line: None, + }, + Op::Text { at: [38.0, 20.5], size: 7.5, anchor: 1, ink: Ink::AxisZ, a: 1.0, s: "Z", bold: true }, + Op::Poly { + pts: &[[38.0, 44.0], [52.2, 52.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisX, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[55.3, 54.0], [51.1, 54.1], [53.3, 50.3]], + closed: true, + fill: Some(P { ink: Ink::AxisX, a: 1.0 }), + grad: None, + line: None, + }, + Op::Text { at: [60.516, 59.5], size: 7.5, anchor: 1, ink: Ink::AxisX, a: 1.0, s: "X", bold: true }, + Op::Poly { + pts: &[[38.0, 44.0], [23.8, 52.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::AxisY, a: 1.0, w: 1.4, dash: [0.0, 0.0], round: true }), + }, + Op::Poly { + pts: &[[20.7, 54.0], [22.7, 50.3], [24.9, 54.1]], + closed: true, + fill: Some(P { ink: Ink::AxisY, a: 1.0 }), + grad: None, + line: None, + }, + Op::Text { at: [15.484, 59.5], size: 7.5, anchor: 1, ink: Ink::AxisY, a: 1.0, s: "Y", bold: true }, + Op::Text { at: [94.0, 30.0], size: 7.5, anchor: 0, ink: Ink::Text, a: 1.0, s: "45°", bold: false }, + Op::Text { at: [94.0, 41.0], size: 7.5, anchor: 0, ink: Ink::Text, a: 1.0, s: "35°", bold: false }, + Op::Text { at: [94.0, 52.0], size: 7.5, anchor: 0, ink: Ink::Text, a: 1.0, s: "0°", bold: false }, + ], +}; + +pub(super) const VIEW_GRID: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[60.0, 13.4], [22.6, 35.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.7, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 13.4], [97.4, 35.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.7, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.2, 17.0], [28.8, 38.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[53.8, 17.0], [91.2, 38.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[72.5, 20.6], [35.1, 42.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[47.5, 20.6], [84.9, 42.2]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[78.7, 24.2], [41.3, 45.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[41.3, 24.2], [78.7, 45.8]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[84.9, 27.8], [47.5, 49.4]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[35.1, 27.8], [72.5, 49.4]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[91.2, 31.4], [53.8, 53.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[28.8, 31.4], [66.2, 53.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.4, w: 0.6, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[97.4, 35.0], [60.0, 56.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.7, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[22.6, 35.0], [60.0, 56.6]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Dim, a: 0.7, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[49.608, 23.0], [60.0, 29.0], [60.0, 41.0], [49.608, 35.0]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[70.392, 23.0], [60.0, 29.0], [60.0, 41.0], [70.392, 35.0]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 17.0], [70.392, 23.0], [60.0, 29.0], [49.608, 23.0]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const VIEW_PERSPECTIVE: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Poly { + pts: &[[30.0, 52.0], [42.0, 24.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 52.0], [78.0, 24.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 52.0], [90.0, 52.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[42.0, 24.0], [78.0, 24.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 1.1, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[30.0, 52.0], [60.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.8, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Poly { + pts: &[[90.0, 52.0], [60.0, 8.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Accent, a: 0.8, w: 1.0, dash: [3.0, 3.0], round: false }), + }, + Op::Circle { + c: [60.0, 8.0, 3.2], + fill: Some(P { ink: Ink::Ground, a: 1.0 }), + line: Some(L { ink: Ink::Reference, a: 1.0, w: 1.5, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [60.0, 8.0, 1.4], fill: Some(P { ink: Ink::Reference, a: 1.0 }), line: None }, + ], +}; + +pub(super) const VIEW_SHADOW: Figure = Figure { + size: [120.0, 64.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 120.0, 64.0], radius: 0.0, fill: Some(P { ink: Ink::Ground, a: 1.0 }), line: None }, + Op::Glow { c: [62.0, 44.0, 26.0, 8.0], a: 0.5 }, + Op::Poly { + pts: &[[48.742, 23.5], [60.0, 30.0], [60.0, 43.0], [48.742, 36.5]], + closed: true, + fill: Some(P { ink: Ink::Left, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[71.258, 23.5], [60.0, 30.0], [60.0, 43.0], [71.258, 36.5]], + closed: true, + fill: Some(P { ink: Ink::Right, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[60.0, 17.0], [71.258, 23.5], [60.0, 30.0], [48.742, 23.5]], + closed: true, + fill: Some(P { ink: Ink::Top, a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Line, a: 1.0, w: 0.9, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +pub(super) const THEME_THUMBNAIL: Figure = Figure { + size: [124.0, 76.0], + ops: &[ + Op::Rect { r: [0.0, 0.0, 124.0, 76.0], radius: 0.0, fill: Some(P { ink: Ink::Slot(0), a: 1.0 }), line: None }, + Op::Rect { r: [0.0, 0.0, 124.0, 14.0], radius: 0.0, fill: Some(P { ink: Ink::Slot(1), a: 1.0 }), line: None }, + Op::Circle { c: [6.0, 7.0, 1.8], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Circle { c: [12.0, 7.0, 1.8], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { r: [24.0, 4.0, 14.0, 6.0], radius: 3.0, fill: Some(P { ink: Ink::Slot(3), a: 1.0 }), line: None }, + Op::Rect { r: [42.0, 5.0, 12.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Slot(2), a: 0.7 }), line: None }, + Op::Rect { r: [58.0, 5.0, 12.0, 4.0], radius: 2.0, fill: Some(P { ink: Ink::Slot(2), a: 0.7 }), line: None }, + Op::Rect { r: [102.0, 3.5, 16.0, 7.0], radius: 3.5, fill: Some(P { ink: Ink::Slot(3), a: 1.0 }), line: None }, + Op::Rect { r: [0.0, 14.0, 35.0, 62.0], radius: 0.0, fill: Some(P { ink: Ink::Slot(1), a: 1.0 }), line: None }, + Op::Rect { r: [3.0, 30.0, 30.0, 8.0], radius: 2.0, fill: Some(P { ink: Ink::Slot(3), a: 0.25 }), line: None }, + Op::Circle { c: [8.0, 26.0, 1.6], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 24.5, 16.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Slot(2), a: 0.8 }), line: None }, + Op::Circle { c: [8.0, 34.0, 1.6], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 32.5, 12.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Slot(2), a: 0.8 }), line: None }, + Op::Circle { c: [8.0, 42.0, 1.6], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 40.5, 17.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Slot(2), a: 0.8 }), line: None }, + Op::Circle { c: [8.0, 50.0, 1.6], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { r: [12.0, 48.5, 11.0, 3.0], radius: 1.5, fill: Some(P { ink: Ink::Slot(2), a: 0.8 }), line: None }, + Op::Poly { + pts: &[ + [117.0, 17.0], + [118.035, 17.136], + [119.0, 17.536], + [119.828, 18.172], + [120.464, 19.0], + [120.864, 19.965], + [121.0, 21.0], + [121.0, 69.0], + [120.864, 70.035], + [120.464, 71.0], + [119.828, 71.828], + [119.0, 72.464], + [118.035, 72.864], + [117.0, 73.0], + [42.0, 73.0], + [40.965, 72.864], + [40.0, 72.464], + [39.172, 71.828], + [38.536, 71.0], + [38.136, 70.035], + [38.0, 69.0], + [38.0, 21.0], + [38.136, 19.965], + [38.536, 19.0], + [39.172, 18.172], + [40.0, 17.536], + [40.965, 17.136], + [42.0, 17.0], + ], + closed: true, + fill: None, + grad: Some(G { top: Ink::Slot(4), bottom: Ink::Slot(5), y: [17.0, 73.0] }), + line: None, + }, + Op::Poly { + pts: &[[44.0, 67.0], [115.0, 67.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Slot(6), a: 0.1, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 60.0], [115.0, 60.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Slot(6), a: 0.1, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 53.0], [115.0, 53.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Slot(6), a: 0.1, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 46.0], [115.0, 46.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Slot(6), a: 0.1, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[44.0, 39.0], [115.0, 39.0]], + closed: false, + fill: None, + grad: None, + line: Some(L { ink: Ink::Slot(6), a: 0.1, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[79.5, 28.0], [92.49, 35.5], [92.49, 50.5], [79.5, 58.0], [66.51, 50.5], [66.51, 35.5]], + closed: true, + fill: None, + grad: None, + line: None, + }, + Op::Poly { + pts: &[[79.5, 28.0], [92.49, 35.5], [79.5, 43.0], [66.51, 35.5]], + closed: true, + fill: Some(P { ink: Ink::Slot(7), a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Slot(8), a: 1.0, w: 0.8, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[66.51, 35.5], [79.5, 43.0], [79.5, 58.0], [66.51, 50.5]], + closed: true, + fill: Some(P { ink: Ink::Slot(9), a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Slot(8), a: 1.0, w: 0.8, dash: [0.0, 0.0], round: false }), + }, + Op::Poly { + pts: &[[92.49, 35.5], [79.5, 43.0], [79.5, 58.0], [92.49, 50.5]], + closed: true, + fill: Some(P { ink: Ink::Slot(10), a: 1.0 }), + grad: None, + line: Some(L { ink: Ink::Slot(8), a: 1.0, w: 0.8, dash: [0.0, 0.0], round: false }), + }, + Op::Circle { c: [65.5, 67.0, 1.7], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Circle { c: [72.5, 67.0, 1.7], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Circle { c: [79.5, 67.0, 1.7], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Circle { c: [86.5, 67.0, 1.7], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Circle { c: [93.5, 67.0, 1.7], fill: Some(P { ink: Ink::Slot(2), a: 1.0 }), line: None }, + Op::Rect { + r: [0.5, 0.5, 123.0, 75.0], + radius: 5.5, + fill: None, + line: Some(L { ink: Ink::Slot(11), a: 1.0, w: 1.0, dash: [0.0, 0.0], round: false }), + }, + ], +}; + +// Theme thumbnail slots (light, dark, gruvbox, imported sample colours): +// 0: #F4F6F9 #2A2F3A #282828 #2B2F52 +// 1: #FFFFFF #323845 #3C3836 #3B4170 +// 2: #9AA7B6 #6C7689 #7C6F64 #9CA3DE +// 3: #236EAD #8CBEF5 #83A598 #B6A6FF +// 4: #EEF1F5 #3A4150 #32302F #6A5AC8 +// 5: #D9DFE7 #252A34 #1D2021 #2E5A9E +// 6: #7B8798 #99A5BA #EBDBB2 #FFFFFF +// 7: #FFFFFF #7E8AA0 #D5C4A1 #E7E1FF +// 8: #7B8798 #99A5BA #EBDBB2 None +// 9: #C3CBD6 #566176 #A89984 #9C8FE8 +// 10: #A8B3C1 #3F485A #7C6F64 #6E8FE0 +// 11: #C9D1DB #454D5E #504945 #6E76B8 + +use super::preferences_figure_ops::paint; +use egui::{Painter, Rect}; + +/// The `aa-2x` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_aa_2x(p: &Painter, rect: Rect) { + paint(p, rect, &AA_2X, None, None); +} + +/// The `aa-4x` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_aa_4x(p: &Painter, rect: Rect) { + paint(p, rect, &AA_4X, None, None); +} + +/// The `aa-8x` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_aa_8x(p: &Painter, rect: Rect) { + paint(p, rect, &AA_8X, None, None); +} + +/// The `aa-off` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_aa_off(p: &Painter, rect: Rect) { + paint(p, rect, &AA_OFF, None, None); +} + +/// The `agent-pointer-speed` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_agent_pointer_speed(p: &Painter, rect: Rect) { + paint(p, rect, &AGENT_POINTER_SPEED, None, None); +} + +/// The `ao-on` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_ao_on(p: &Painter, rect: Rect) { + paint(p, rect, &AO_ON, None, None); +} + +/// The `assembly-move` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_assembly_move(p: &Painter, rect: Rect) { + paint(p, rect, &ASSEMBLY_MOVE, None, None); +} + +/// The `browser-card` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_browser_card(p: &Painter, rect: Rect) { + paint(p, rect, &BROWSER_CARD, None, None); +} + +/// The `browser-column` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_browser_column(p: &Painter, rect: Rect) { + paint(p, rect, &BROWSER_COLUMN, None, None); +} + +/// The `colour-vision-axes` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_axes(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_AXES, None, None); +} + +/// The `colour-vision-bends` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_bends(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_BENDS, None, None); +} + +/// The `colour-vision-draft` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_draft(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_DRAFT, None, None); +} + +/// The `colour-vision-failed` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_failed(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_FAILED, None, None); +} + +/// The `colour-vision-fixed` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_fixed(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_FIXED, None, None); +} + +/// The `colour-vision-projected` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_colour_vision_projected(p: &Painter, rect: Rect) { + paint(p, rect, &COLOUR_VISION_PROJECTED, None, None); +} + +/// The `direct-interaction` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_direct_interaction(p: &Painter, rect: Rect) { + paint(p, rect, &DIRECT_INTERACTION, None, None); +} + +/// The `frame-rate` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_frame_rate(p: &Painter, rect: Rect) { + paint(p, rect, &FRAME_RATE, None, None); +} + +/// The `history-bottom` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_history_bottom(p: &Painter, rect: Rect) { + paint(p, rect, &HISTORY_BOTTOM, None, None); +} + +/// The `history-in-browser` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_history_in_browser(p: &Painter, rect: Rect) { + paint(p, rect, &HISTORY_IN_BROWSER, None, None); +} + +/// The `history-left` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_history_left(p: &Painter, rect: Rect) { + paint(p, rect, &HISTORY_LEFT, None, None); +} + +/// The `history-under-browser` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_history_under_browser(p: &Painter, rect: Rect) { + paint(p, rect, &HISTORY_UNDER_BROWSER, None, None); +} + +/// The `layout-schematic` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_layout_schematic(p: &Painter, rect: Rect) { + paint(p, rect, &LAYOUT_SCHEMATIC, None, None); +} + +/// The `measure-axis-distances` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_measure_axis_distances(p: &Painter, rect: Rect) { + paint(p, rect, &MEASURE_AXIS_DISTANCES, None, None); +} + +/// The `mouse-mapping` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_mouse_mapping(p: &Painter, rect: Rect) { + paint(p, rect, &MOUSE_MAPPING, None, None); +} + +/// The `navigator-axes` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_navigator_axes(p: &Painter, rect: Rect) { + paint(p, rect, &NAVIGATOR_AXES, None, None); +} + +/// The `navigator-cube` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_navigator_cube(p: &Painter, rect: Rect) { + paint(p, rect, &NAVIGATOR_CUBE, None, None); +} + +/// The `orbit-centre` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_orbit_centre(p: &Painter, rect: Rect) { + paint(p, rect, &ORBIT_CENTRE, None, None); +} + +/// The `orbit-cursor` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_orbit_cursor(p: &Painter, rect: Rect) { + paint(p, rect, &ORBIT_CURSOR, None, None); +} + +/// The `orbit-origin` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_orbit_origin(p: &Painter, rect: Rect) { + paint(p, rect, &ORBIT_ORIGIN, None, None); +} + +/// The `quick-measure` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_quick_measure(p: &Painter, rect: Rect) { + paint(p, rect, &QUICK_MEASURE, None, None); +} + +/// The `select-bodies` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_select_bodies(p: &Painter, rect: Rect) { + paint(p, rect, &SELECT_BODIES, None, None); +} + +/// The `select-faces-edges` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_select_faces_edges(p: &Painter, rect: Rect) { + paint(p, rect, &SELECT_FACES_EDGES, None, None); +} + +/// The `sketch-conflict` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_conflict(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_CONFLICT, None, None); +} + +/// The `sketch-exit-keep` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_exit_keep(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_EXIT_KEEP, None, None); +} + +/// The `sketch-exit-previous` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_exit_previous(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_EXIT_PREVIOUS, None, None); +} + +/// The `sketch-exit-unless-turned` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_exit_unless_turned(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_EXIT_UNLESS_TURNED, None, None); +} + +/// The `sketch-guides` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_guides(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_GUIDES, None, None); +} + +/// The `sketch-hide-glyphs` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_hide_glyphs(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_HIDE_GLYPHS, None, None); +} + +/// The `sketch-state-icons` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_sketch_state_icons(p: &Painter, rect: Rect) { + paint(p, rect, &SKETCH_STATE_ICONS, None, None); +} + +/// The `tess-coarse` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tess_coarse(p: &Painter, rect: Rect) { + paint(p, rect, &TESS_COARSE, None, None); +} + +/// The `tess-fine` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tess_fine(p: &Painter, rect: Rect) { + paint(p, rect, &TESS_FINE, None, None); +} + +/// The `tess-normal` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tess_normal(p: &Painter, rect: Rect) { + paint(p, rect, &TESS_NORMAL, None, None); +} + +/// The `tess-ultra` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tess_ultra(p: &Painter, rect: Rect) { + paint(p, rect, &TESS_ULTRA, None, None); +} + +/// The `tool-cursor` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tool_cursor(p: &Painter, rect: Rect) { + paint(p, rect, &TOOL_CURSOR, None, None); +} + +/// The `tool-extrude` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tool_extrude(p: &Painter, rect: Rect) { + paint(p, rect, &TOOL_EXTRUDE, None, None); +} + +/// The `tool-hole` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tool_hole(p: &Painter, rect: Rect) { + paint(p, rect, &TOOL_HOLE, None, None); +} + +/// The `tool-placement` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_tool_placement(p: &Painter, rect: Rect) { + paint(p, rect, &TOOL_PLACEMENT, None, None); +} + +/// The `vertex-markers` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_vertex_markers(p: &Painter, rect: Rect) { + paint(p, rect, &VERTEX_MARKERS, None, None); +} + +/// The `view-angles` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_view_angles(p: &Painter, rect: Rect) { + paint(p, rect, &VIEW_ANGLES, None, None); +} + +/// The `view-grid` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_view_grid(p: &Painter, rect: Rect) { + paint(p, rect, &VIEW_GRID, None, None); +} + +/// The `view-perspective` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_view_perspective(p: &Painter, rect: Rect) { + paint(p, rect, &VIEW_PERSPECTIVE, None, None); +} + +/// The `view-shadow` figure of `docs/design/preferences/figures`. +pub(crate) fn paint_view_shadow(p: &Painter, rect: Rect) { + paint(p, rect, &VIEW_SHADOW, None, None); +} + +/// Every figure painter by file name, for the gallery and the tests. +pub(crate) const FIGURES: &[(&str, [f32; 2], fn(&Painter, Rect))] = &[ + ("aa-2x", AA_2X.size, paint_aa_2x), + ("aa-4x", AA_4X.size, paint_aa_4x), + ("aa-8x", AA_8X.size, paint_aa_8x), + ("aa-off", AA_OFF.size, paint_aa_off), + ("agent-pointer-speed", AGENT_POINTER_SPEED.size, paint_agent_pointer_speed), + ("ao-on", AO_ON.size, paint_ao_on), + ("assembly-move", ASSEMBLY_MOVE.size, paint_assembly_move), + ("browser-card", BROWSER_CARD.size, paint_browser_card), + ("browser-column", BROWSER_COLUMN.size, paint_browser_column), + ("colour-vision-axes", COLOUR_VISION_AXES.size, paint_colour_vision_axes), + ("colour-vision-bends", COLOUR_VISION_BENDS.size, paint_colour_vision_bends), + ("colour-vision-draft", COLOUR_VISION_DRAFT.size, paint_colour_vision_draft), + ("colour-vision-failed", COLOUR_VISION_FAILED.size, paint_colour_vision_failed), + ("colour-vision-fixed", COLOUR_VISION_FIXED.size, paint_colour_vision_fixed), + ("colour-vision-projected", COLOUR_VISION_PROJECTED.size, paint_colour_vision_projected), + ("direct-interaction", DIRECT_INTERACTION.size, paint_direct_interaction), + ("frame-rate", FRAME_RATE.size, paint_frame_rate), + ("history-bottom", HISTORY_BOTTOM.size, paint_history_bottom), + ("history-in-browser", HISTORY_IN_BROWSER.size, paint_history_in_browser), + ("history-left", HISTORY_LEFT.size, paint_history_left), + ("history-under-browser", HISTORY_UNDER_BROWSER.size, paint_history_under_browser), + ("layout-schematic", LAYOUT_SCHEMATIC.size, paint_layout_schematic), + ("measure-axis-distances", MEASURE_AXIS_DISTANCES.size, paint_measure_axis_distances), + ("mouse-mapping", MOUSE_MAPPING.size, paint_mouse_mapping), + ("navigator-axes", NAVIGATOR_AXES.size, paint_navigator_axes), + ("navigator-cube", NAVIGATOR_CUBE.size, paint_navigator_cube), + ("orbit-centre", ORBIT_CENTRE.size, paint_orbit_centre), + ("orbit-cursor", ORBIT_CURSOR.size, paint_orbit_cursor), + ("orbit-origin", ORBIT_ORIGIN.size, paint_orbit_origin), + ("quick-measure", QUICK_MEASURE.size, paint_quick_measure), + ("select-bodies", SELECT_BODIES.size, paint_select_bodies), + ("select-faces-edges", SELECT_FACES_EDGES.size, paint_select_faces_edges), + ("sketch-conflict", SKETCH_CONFLICT.size, paint_sketch_conflict), + ("sketch-exit-keep", SKETCH_EXIT_KEEP.size, paint_sketch_exit_keep), + ("sketch-exit-previous", SKETCH_EXIT_PREVIOUS.size, paint_sketch_exit_previous), + ("sketch-exit-unless-turned", SKETCH_EXIT_UNLESS_TURNED.size, paint_sketch_exit_unless_turned), + ("sketch-guides", SKETCH_GUIDES.size, paint_sketch_guides), + ("sketch-hide-glyphs", SKETCH_HIDE_GLYPHS.size, paint_sketch_hide_glyphs), + ("sketch-state-icons", SKETCH_STATE_ICONS.size, paint_sketch_state_icons), + ("tess-coarse", TESS_COARSE.size, paint_tess_coarse), + ("tess-fine", TESS_FINE.size, paint_tess_fine), + ("tess-normal", TESS_NORMAL.size, paint_tess_normal), + ("tess-ultra", TESS_ULTRA.size, paint_tess_ultra), + ("tool-cursor", TOOL_CURSOR.size, paint_tool_cursor), + ("tool-extrude", TOOL_EXTRUDE.size, paint_tool_extrude), + ("tool-hole", TOOL_HOLE.size, paint_tool_hole), + ("tool-placement", TOOL_PLACEMENT.size, paint_tool_placement), + ("vertex-markers", VERTEX_MARKERS.size, paint_vertex_markers), + ("view-angles", VIEW_ANGLES.size, paint_view_angles), + ("view-grid", VIEW_GRID.size, paint_view_grid), + ("view-perspective", VIEW_PERSPECTIVE.size, paint_view_perspective), + ("view-shadow", VIEW_SHADOW.size, paint_view_shadow), +]; diff --git a/crates/ui-egui/src/ui_kit/preferences_figure_ops.rs b/crates/ui-egui/src/ui_kit/preferences_figure_ops.rs new file mode 100644 index 000000000..b3656dc3f --- /dev/null +++ b/crates/ui-egui/src/ui_kit/preferences_figure_ops.rs @@ -0,0 +1,583 @@ +//! The drawing engine behind the Preferences figures: a figure is a short list of operations in its +//! own coordinates (`preferences_figure_data.rs`, compiled from the SVGs in +//! `docs/design/preferences/figures/`), painted with egui shapes in the colours of the current +//! `Tokens`. Nothing is rasterised and no image is loaded; every figure costs a few dozen shapes. +//! Any rectangle, including an empty, infinite or enormous one, is safe to paint into. +use crate::theme::Tokens; +use egui::{Align2, Color32, CornerRadius, FontId, Mesh, Painter, Pos2, Rect, Shape, Stroke, StrokeKind, pos2, vec2}; + +/// Colour roles of the figures. Each reads one `Tokens` field (`docs/design/preferences/tokens.md`). +#[derive(Clone, Copy, Debug)] +pub(super) enum Ink { + Ground, + Line, + Top, + Left, + Right, + Card, + Accent, + Reference, + AxisX, + AxisY, + AxisZ, + Ok, + Warn, + Dim, + Text, + Border, + ControlBorder, + Control, + Note, + NoteFill, + White, + Black, + /// Colour vision sample colours: Z axis blue, projected, X axis, bend up and bend down. + Cv0, + Cv1, + Cv2, + Cv3, + Cv4, + /// A colour of a theme thumbnail, from its `ThemeSample`. + Slot(u8), +} + +#[derive(Clone, Copy, Debug)] +pub(super) struct P { + pub ink: Ink, + pub a: f32, +} + +#[derive(Clone, Copy, Debug)] +pub(super) struct L { + pub ink: Ink, + pub a: f32, + pub w: f32, + /// Dash and gap, `[0.0, 0.0]` for a solid line. + pub dash: [f32; 2], + pub round: bool, +} + +/// A vertical gradient over the figure's `y` range. +#[derive(Clone, Copy, Debug)] +pub(super) struct G { + pub top: Ink, + pub bottom: Ink, + pub y: [f32; 2], +} + +#[derive(Clone, Copy, Debug)] +pub(super) enum Op { + Rect { + r: [f32; 4], + radius: f32, + fill: Option

, + line: Option, + }, + Circle { + c: [f32; 3], + fill: Option

, + line: Option, + }, + Poly { + pts: &'static [[f32; 2]], + closed: bool, + fill: Option

, + grad: Option, + line: Option, + }, + /// A soft black ellipse: opaque `a` at the centre, clear at the edge. + Glow { + c: [f32; 4], + a: f32, + }, + Text { + at: [f32; 2], + size: f32, + anchor: u8, + ink: Ink, + a: f32, + s: &'static str, + bold: bool, + }, + Clip(&'static [[f32; 2]]), + Unclip, +} + +#[derive(Clone, Copy, Debug)] +pub(super) struct Figure { + pub size: [f32; 2], + pub ops: &'static [Op], +} + +/// The twelve colours a theme thumbnail is drawn with: ground, bar and side panel, muted marks, +/// accent, the window face's top and bottom, grid, cube top, cube outline, cube left, cube right +/// and the thumbnail's border. A colour may carry alpha (a glass theme's panels). +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct ThemeSample { + pub slots: [Color32; 12], +} + +impl ThemeSample { + /// A thumbnail of the theme whose tokens these are. + pub fn from_tokens(t: &Tokens) -> ThemeSample { + let mix = |a: Color32, b: Color32, f: f32| a.lerp_to_gamma(b, f); + ThemeSample { + slots: [ + t.dialog_footer, + t.control_fill, + t.form_dim.gamma_multiply(0.7), + t.form_primary, + t.viewport_top, + t.viewport_bottom, + t.form_dim.gamma_multiply(0.1), + t.body, + t.form_dim, + mix(t.body, t.body_edge, 0.25), + mix(t.body, t.body_edge, 0.5), + t.dialog_border, + ], + } + } + + /// The same colours with every alpha scaled (a glass theme's fills). + pub fn glass(mut self, alpha: f32) -> ThemeSample { + for slot in &mut self.slots[1..2] { + *slot = slot.gamma_multiply(alpha); + } + self + } +} + +/// Largest side, in points, a figure is painted at; anything larger is skipped, not drawn wrong. +const MAX_SIDE: f32 = 16_384.0; +const MAX_POINTS: usize = 512; + +struct Ctx<'a> { + t: &'a Tokens, + sample: Option<&'a ThemeSample>, + origin: Pos2, + scale: f32, +} + +impl Ctx<'_> { + fn ink(&self, ink: Ink, a: f32) -> Color32 { + let t = self.t; + let c = match ink { + Ink::Ground => t.figure_ground, + Ink::Line => t.figure_line, + Ink::Top => t.figure_face_top, + Ink::Left => t.figure_face_left, + Ink::Right => t.figure_face_right, + Ink::Card => t.figure_card, + Ink::Accent => t.figure_accent, + Ink::Reference => t.figure_reference, + Ink::AxisX => t.figure_axis_x, + Ink::AxisY => t.figure_axis_y, + Ink::AxisZ => t.figure_axis_z, + Ink::Ok => t.figure_ok, + Ink::Warn => t.figure_warn, + Ink::Dim => t.form_dim, + Ink::Text => t.form_ink, + Ink::Border => t.dialog_border, + Ink::ControlBorder => t.control_border, + Ink::Control => t.control_fill, + Ink::Note => t.pref_note, + Ink::NoteFill => t.pref_note_fill, + Ink::White => t.figure_white, + Ink::Black => t.figure_black, + Ink::Cv0 => t.axis_z, + Ink::Cv1 => t.sketch_projected, + Ink::Cv2 => t.axis_x, + Ink::Cv3 => t.bend_up, + Ink::Cv4 => t.bend_down, + Ink::Slot(n) => self.sample.and_then(|s| s.slots.get(n as usize).copied()).unwrap_or(Color32::TRANSPARENT), + }; + if a >= 1.0 { c } else { c.gamma_multiply(a.clamp(0.0, 1.0)) } + } + + fn at(&self, p: [f32; 2]) -> Pos2 { + self.origin + vec2(p[0] * self.scale, p[1] * self.scale) + } + + fn stroke(&self, line: &L) -> Stroke { + Stroke::new((line.w * self.scale).clamp(0.0, 64.0), self.ink(line.ink, line.a)) + } +} + +/// Paints `figure` into `rect`, scaled to fit and centred, with `Tokens::get()` colours. +pub(super) fn paint(p: &Painter, rect: Rect, figure: &Figure, sample: Option<&ThemeSample>, clip: Option<&[[f32; 2]]>) { + let size = rect.size(); + if !rect.min.is_finite() || !size.is_finite() || size.x < 1.0 || size.y < 1.0 || size.x > MAX_SIDE || size.y > MAX_SIDE { + return; + } + let [fw, fh] = figure.size; + if !(fw > 0.0 && fh > 0.0) { + return; + } + let scale = (size.x / fw).min(size.y / fh); + let fitted = Rect::from_center_size(rect.center(), vec2(fw * scale, fh * scale)); + let t = Tokens::get(); + let ctx = Ctx { t: &t, sample, origin: fitted.min, scale }; + let p = p.with_clip_rect(fitted.intersect(p.clip_rect())); + let outer: Option> = clip.map(|c| c.iter().map(|&q| ctx.at(q)).collect()); + // Nested clips are inside one another in every figure, so the innermost one is the clip. + let mut stack: Vec> = Vec::new(); + for op in figure.ops { + match op { + Op::Clip(points) if outer.is_none() => stack.push(points.iter().map(|&q| ctx.at(q)).collect()), + Op::Unclip if outer.is_none() => { + stack.pop(); + } + Op::Clip(_) | Op::Unclip => {} + _ => draw(&p, &ctx, op, outer.as_deref().or(stack.last().map(Vec::as_slice))), + } + } +} + +fn draw(p: &Painter, ctx: &Ctx, op: &Op, clip: Option<&[Pos2]>) { + match op { + Op::Rect { r, radius, fill, line } => { + let rect = Rect::from_min_size(ctx.at([r[0], r[1]]), vec2(r[2] * ctx.scale, r[3] * ctx.scale)); + if clip.is_some() { + let pts = rounded(rect, radius * ctx.scale); + poly(p, ctx, &pts, true, fill, None, line, clip); + return; + } + let corner = CornerRadius::same((radius * ctx.scale).clamp(0.0, 255.0).round() as u8); + if let Some(f) = fill { + p.rect_filled(rect, corner, ctx.ink(f.ink, f.a)); + } + if let Some(l) = line { + p.rect_stroke(rect, corner, ctx.stroke(l), StrokeKind::Middle); + } + } + Op::Circle { c, fill, line } => { + let centre = ctx.at([c[0], c[1]]); + let radius = c[2] * ctx.scale; + if clip.is_some() { + let pts: Vec = (0..24) + .map(|i| { + let a = i as f32 * std::f32::consts::TAU / 24.0; + centre + vec2(a.cos(), a.sin()) * radius + }) + .collect(); + poly(p, ctx, &pts, true, fill, None, line, clip); + return; + } + if let Some(f) = fill { + p.circle_filled(centre, radius, ctx.ink(f.ink, f.a)); + } + if let Some(l) = line { + p.circle_stroke(centre, radius, ctx.stroke(l)); + } + } + Op::Poly { pts, closed, fill, grad, line } => { + let points: Vec = pts.iter().map(|&q| ctx.at(q)).collect(); + poly(p, ctx, &points, *closed, fill, grad.as_ref(), line, clip); + } + Op::Glow { c, a } => { + let centre = ctx.at([c[0], c[1]]); + let radius = vec2(c[2] * ctx.scale, c[3] * ctx.scale); + glow(p, centre, radius, ctx.ink(Ink::Black, *a)); + } + Op::Text { at, size, anchor, ink, a, s, .. } => { + if clip.is_some() { + return; + } + let align = match anchor { + 1 => Align2::CENTER_CENTER, + 2 => Align2::RIGHT_CENTER, + _ => Align2::LEFT_CENTER, + }; + // The board's captions are 6.5 to 7.5 units: too small to read at card size, so they + // are drawn a third larger (never under 8 points). The SVG's `y` is the baseline, which + // sits about 0.36 em below the middle of a line of digits and capitals. + // Longer captions sit in tight pills and on cube faces, so they are drawn slightly smaller than the board (egui's monospace face is wider than the board's). + let grow = match s.chars().count() { + 0..=4 => 1.2, + 5..=6 => 0.9, + _ => 0.76, + }; + let size = (size * ctx.scale * grow).clamp(7.0, 256.0); + let at = ctx.at(*at) - vec2(0.0, size * 0.36); + p.text(at, align, s, FontId::monospace(size), ctx.ink(*ink, *a)); + } + Op::Clip(_) | Op::Unclip => {} + } +} + +#[allow(clippy::too_many_arguments)] +fn poly(p: &Painter, ctx: &Ctx, pts: &[Pos2], closed: bool, fill: &Option

, grad: Option<&G>, line: &Option, clip: Option<&[Pos2]>) { + if pts.len() < 2 || pts.len() > MAX_POINTS || pts.iter().any(|q| !q.is_finite()) { + return; + } + let clipped; + let (shape, fillable) = match clip { + Some(c) if pts.len() >= 3 && closed => { + clipped = clip_polygon(pts, c); + (&clipped[..], clipped.len() >= 3) + } + _ => (pts, pts.len() >= 3 && closed), + }; + if fillable { + if let Some(g) = grad { + let (top, bottom) = (ctx.ink(g.top, 1.0), ctx.ink(g.bottom, 1.0)); + let (y0, y1) = (ctx.at([0.0, g.y[0]]).y, ctx.at([0.0, g.y[1]]).y); + let span = (y1 - y0).max(1e-3); + fill_polygon(p, shape, |q| top.lerp_to_gamma(bottom, ((q.y - y0) / span).clamp(0.0, 1.0))); + } else if let Some(f) = fill { + let c = ctx.ink(f.ink, f.a); + fill_polygon(p, shape, |_| c); + } + } + if let Some(l) = line { + let stroke = ctx.stroke(l); + if stroke.width <= 0.0 || stroke.color == Color32::TRANSPARENT { + return; + } + let mut path = pts.to_vec(); + if closed { + path.push(pts[0]); + } + let runs = match clip { + Some(c) => clip_path(&path, c), + None => vec![path], + }; + for run in runs { + if l.dash[0] > 0.0 && l.dash[1] > 0.0 { + let dash = (l.dash[0] * ctx.scale).max(0.5); + let gap = (l.dash[1] * ctx.scale).max(0.5); + p.extend(crate::viewport::dashed_line(&run, p.clip_rect(), stroke, dash, gap)); + } else { + p.add(Shape::line(run, stroke)); + } + } + } +} + +fn rounded(rect: Rect, radius: f32) -> Vec { + let r = radius.min(rect.width() * 0.5).min(rect.height() * 0.5).max(0.0); + if r < 0.01 { + return vec![rect.left_top(), rect.right_top(), rect.right_bottom(), rect.left_bottom()]; + } + let mut out = Vec::with_capacity(28); + for (centre, start) in [ + (rect.right_top() + vec2(-r, r), -90.0_f32), + (rect.right_bottom() + vec2(-r, -r), 0.0), + (rect.left_bottom() + vec2(r, -r), 90.0), + (rect.left_top() + vec2(r, r), 180.0), + ] { + for k in 0..=6 { + let a = (start + 90.0 * k as f32 / 6.0).to_radians(); + out.push(centre + vec2(a.cos(), a.sin()) * r); + } + } + out +} + +fn cross(o: Pos2, a: Pos2, b: Pos2) -> f32 { + (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x) +} + +fn is_convex(pts: &[Pos2]) -> bool { + let n = pts.len(); + let mut sign = 0.0_f32; + for i in 0..n { + let c = cross(pts[i], pts[(i + 1) % n], pts[(i + 2) % n]); + if c.abs() < 1e-4 { + continue; + } + if sign == 0.0 { + sign = c.signum(); + } else if c.signum() != sign { + return false; + } + } + true +} + +/// Fills a simple polygon with `colour_at` per vertex: as a convex polygon when it is one, else by +/// ear clipping (at most `MAX_POINTS` vertices). +fn fill_polygon(p: &Painter, pts: &[Pos2], colour_at: impl Fn(Pos2) -> Color32) { + let n = pts.len(); + if !(3..=MAX_POINTS).contains(&n) { + return; + } + let mut mesh = Mesh::default(); + for &q in pts { + mesh.colored_vertex(q, colour_at(q)); + } + if is_convex(pts) { + for i in 1..n as u32 - 1 { + mesh.add_triangle(0, i, i + 1); + } + } else { + let area: f32 = (0..n).map(|i| pts[i].x * pts[(i + 1) % n].y - pts[(i + 1) % n].x * pts[i].y).sum(); + let mut idx: Vec = if area >= 0.0 { (0..n).collect() } else { (0..n).rev().collect() }; + let mut guard = 0; + while idx.len() > 3 && guard < n * n { + guard += 1; + let m = idx.len(); + let mut cut = None; + for k in 0..m { + let (a, b, c) = (idx[(k + m - 1) % m], idx[k], idx[(k + 1) % m]); + if cross(pts[a], pts[b], pts[c]) <= 0.0 { + continue; + } + let inside = idx.iter().any(|&o| { + o != a + && o != b + && o != c + && cross(pts[a], pts[b], pts[o]) >= 0.0 + && cross(pts[b], pts[c], pts[o]) >= 0.0 + && cross(pts[c], pts[a], pts[o]) >= 0.0 + }); + if !inside { + cut = Some(k); + break; + } + } + let Some(k) = cut else { break }; + let (a, b, c) = (idx[(k + m - 1) % m], idx[k], idx[(k + 1) % m]); + mesh.add_triangle(a as u32, b as u32, c as u32); + idx.remove(k); + } + if idx.len() == 3 { + mesh.add_triangle(idx[0] as u32, idx[1] as u32, idx[2] as u32); + } + } + p.add(Shape::mesh(mesh)); +} + +fn glow(p: &Painter, centre: Pos2, radius: egui::Vec2, ink: Color32) { + const SEGMENTS: u32 = 32; + if !(radius.x > 0.0 && radius.y > 0.0) { + return; + } + let mut mesh = Mesh::default(); + mesh.colored_vertex(centre, ink); + for i in 0..=SEGMENTS { + let a = std::f32::consts::TAU * i as f32 / SEGMENTS as f32; + mesh.colored_vertex(centre + vec2(a.cos() * radius.x, a.sin() * radius.y), Color32::TRANSPARENT); + } + for i in 1..=SEGMENTS { + mesh.add_triangle(0, i, i + 1); + } + p.add(Shape::mesh(mesh)); +} + +/// Sutherland-Hodgman clip of a polygon against a convex clip polygon of either winding. +fn clip_polygon(subject: &[Pos2], clip: &[Pos2]) -> Vec { + let n = clip.len(); + if n < 3 { + return Vec::new(); + } + let area: f32 = (0..n).map(|i| clip[i].x * clip[(i + 1) % n].y - clip[(i + 1) % n].x * clip[i].y).sum(); + let side = if area >= 0.0 { 1.0 } else { -1.0 }; + let mut out = subject.to_vec(); + for i in 0..n { + let (a, b) = (clip[i], clip[(i + 1) % n]); + let inside = |q: Pos2| side * cross(a, b, q) >= 0.0; + let input = std::mem::take(&mut out); + if input.is_empty() { + break; + } + for j in 0..input.len() { + let (cur, prev) = (input[j], input[(j + input.len() - 1) % input.len()]); + if inside(cur) { + if !inside(prev) { + out.push(intersect(prev, cur, a, b)); + } + out.push(cur); + } else if inside(prev) { + out.push(intersect(prev, cur, a, b)); + } + } + } + out +} + +fn intersect(p1: Pos2, p2: Pos2, a: Pos2, b: Pos2) -> Pos2 { + let (d1, d2) = (p2 - p1, b - a); + let den = d1.x * d2.y - d1.y * d2.x; + if den.abs() < 1e-9 { + return p1; + } + let t = ((a.x - p1.x) * d2.y - (a.y - p1.y) * d2.x) / den; + pos2(p1.x + d1.x * t, p1.y + d1.y * t) +} + +/// The parts of a polyline inside a convex clip polygon (Cyrus-Beck per segment). +fn clip_path(path: &[Pos2], clip: &[Pos2]) -> Vec> { + let n = clip.len(); + if n < 3 { + return Vec::new(); + } + let area: f32 = (0..n).map(|i| clip[i].x * clip[(i + 1) % n].y - clip[(i + 1) % n].x * clip[i].y).sum(); + let side = if area >= 0.0 { 1.0 } else { -1.0 }; + let mut runs: Vec> = Vec::new(); + for w in path.windows(2) { + let (mut t0, mut t1) = (0.0_f32, 1.0_f32); + let d = w[1] - w[0]; + let mut visible = true; + for i in 0..n { + let (a, b) = (clip[i], clip[(i + 1) % n]); + let num = side * cross(a, b, w[0]); + // The signed distance of the point at t from this edge is num + t * den. + let den = side * cross(a, b, w[1]) - num; + if den.abs() < 1e-9 { + if num < 0.0 { + visible = false; + break; + } + } else { + let t = -num / den; + if den > 0.0 { + t0 = t0.max(t); + } else { + t1 = t1.min(t); + } + } + } + if visible && t0 < t1 { + let (a, b) = (w[0] + d * t0, w[0] + d * t1); + match runs.last_mut() { + Some(run) if run.last().is_some_and(|l| l.distance(a) < 1e-3) => run.push(b), + _ => runs.push(vec![a, b]), + } + } + } + runs +} + +#[cfg(test)] +mod tests { + use super::*; + + fn square() -> Vec { + vec![pos2(0.0, 0.0), pos2(10.0, 0.0), pos2(10.0, 10.0), pos2(0.0, 10.0)] + } + + #[test] + fn clipping_a_square_to_a_triangle_keeps_the_overlap() { + let tri = [pos2(0.0, 0.0), pos2(10.0, 0.0), pos2(0.0, 10.0)]; + let out = clip_polygon(&square(), &tri); + let n = out.len(); + let area: f32 = (0..n).map(|i| out[i].x * out[(i + 1) % n].y - out[(i + 1) % n].x * out[i].y).sum::().abs() / 2.0; + assert!((area - 50.0).abs() < 1e-3, "{area}"); + } + + #[test] + fn a_path_is_cut_at_the_clip_edge() { + let tri = [pos2(0.0, 0.0), pos2(10.0, 0.0), pos2(0.0, 10.0)]; + let runs = clip_path(&[pos2(-5.0, 2.0), pos2(15.0, 2.0)], &tri); + assert_eq!(runs.len(), 1); + assert!((runs[0][0].x - 0.0).abs() < 1e-3 && (runs[0][1].x - 8.0).abs() < 1e-3, "{:?}", runs); + } + + #[test] + fn concave_polygons_are_detected() { + assert!(is_convex(&square())); + assert!(!is_convex(&[pos2(0.0, 0.0), pos2(10.0, 0.0), pos2(5.0, 2.0), pos2(10.0, 10.0), pos2(0.0, 10.0)])); + } +} diff --git a/crates/ui-egui/src/ui_kit/preferences_figures.rs b/crates/ui-egui/src/ui_kit/preferences_figures.rs index 2c7ce82b2..7bbcd2895 100644 --- a/crates/ui-egui/src/ui_kit/preferences_figures.rs +++ b/crates/ui-egui/src/ui_kit/preferences_figures.rs @@ -260,6 +260,26 @@ pub(crate) fn paint_layout(ui: &mut egui::Ui, state: super::preferences::LayoutP super::text(ui, crate::i18n::tr("prefs.preview_choices"), super::Text::Note("preview")); } +#[allow(unused_imports, reason = "painted by the Preferences pages of #9875 to #9883")] +pub(crate) use super::preferences_figure_ops::ThemeSample; +use super::preferences_figure_ops::paint; + +#[allow(dead_code, reason = "painted by the Preferences pages of #9875 to #9883")] +/// A theme card's miniature application window, drawn with the theme's own `sample` colours. +pub(crate) fn paint_theme_thumbnail(p: &Painter, rect: Rect, sample: &ThemeSample) { + paint(p, rect, &super::preferences_figure_data::THEME_THUMBNAIL, Some(sample), None); +} + +#[allow(dead_code, reason = "painted by the Preferences pages of #9875 to #9883")] +/// The "System" theme card: `light` with `dark` over a slanted band of it (the board clips the dark +/// half to the polygon 56 %,0 / 100 %,0 / 100 %,100 % / 40 %,100 %). +pub(crate) fn paint_theme_system(p: &Painter, rect: Rect, light: &ThemeSample, dark: &ThemeSample) { + const BAND: [[f32; 2]; 4] = [[69.44, 0.0], [124.0, 0.0], [124.0, 76.0], [49.6, 76.0]]; + let figure = &super::preferences_figure_data::THEME_THUMBNAIL; + paint(p, rect, figure, Some(light), None); + paint(p, rect, figure, Some(dark), Some(&BAND)); +} + #[cfg(test)] mod tests { use super::orientation_axes; @@ -281,4 +301,101 @@ mod tests { } } } + + use super::{ThemeSample, paint_theme_system, paint_theme_thumbnail}; + use crate::theme::Tokens; + use crate::ui_kit::preferences_figure_data::FIGURES; + use egui::{Pos2, Rect, vec2}; + + /// Shapes a figure paints into `rect` on a fresh frame, in the given theme. + fn shapes(rect: Rect, paint: impl Fn(&egui::Painter, Rect)) -> Vec { + let ctx = crate::fonts::test_context(); + let mut output = + ctx.run_ui(egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(400.0, 300.0))), ..Default::default() }, |ui| { + paint(ui.painter(), rect); + }); + output.textures_delta.clear(); + output.shapes + } + + fn rects() -> Vec { + let nan = f32::NAN; + vec![ + Rect::from_min_size(Pos2::ZERO, vec2(0.0, 0.0)), + Rect::from_min_size(Pos2::ZERO, vec2(0.2, 0.2)), + Rect::from_min_size(Pos2::new(5.0, 5.0), vec2(1.0, 1.0)), + Rect::from_min_size(Pos2::new(5.0, 5.0), vec2(3.0, 200.0)), + Rect::from_min_size(Pos2::new(5.0, 5.0), vec2(120.0, 64.0)), + Rect::from_min_size(Pos2::new(-50.0, -50.0), vec2(300.0, 300.0)), + Rect::from_min_size(Pos2::ZERO, vec2(1.0e5, 1.0e5)), + Rect::from_min_size(Pos2::ZERO, vec2(f32::INFINITY, 10.0)), + Rect::from_min_size(Pos2::new(nan, 0.0), vec2(10.0, 10.0)), + Rect::from_min_size(Pos2::ZERO, vec2(-40.0, 30.0)), + Rect::from_min_size(Pos2::ZERO, vec2(nan, nan)), + ] + } + + /// Every figure, in both themes, paints at size zero, tiny, normal, huge and non-finite without + /// panicking, and at a normal size stays inside its rectangle with a bounded number of shapes. + #[test] + fn every_preference_figure_paints_safely_at_any_size_in_both_themes() { + let previous = crate::theme::is_dark(); + for dark in [false, true] { + crate::theme::set_dark(dark); + assert!(!FIGURES.is_empty()); + for (name, size, paint) in FIGURES { + for rect in rects() { + let _ = shapes(rect, paint); + } + let rect = Rect::from_min_size(Pos2::new(20.0, 10.0), vec2(size[0] * 2.0, size[1] * 2.0)); + let painted = shapes(rect, paint); + assert!(!painted.is_empty() && painted.len() < 700, "{name}: {} shapes", painted.len()); + for shape in &painted { + let bounds = shape.shape.visual_bounding_rect().intersect(shape.clip_rect); + if bounds.is_positive() { + assert!(rect.expand(1.0).contains_rect(bounds), "{name}: {bounds:?} outside {rect:?}"); + } + } + } + } + crate::theme::set_dark(previous); + } + + /// The figures read the theme: the same figure paints different colours in light and dark. + #[test] + fn preference_figures_follow_the_theme() { + let previous = crate::theme::is_dark(); + let rect = Rect::from_min_size(Pos2::ZERO, vec2(120.0, 64.0)); + let colours = |dark: bool| { + crate::theme::set_dark(dark); + let mut all = Vec::new(); + for shape in shapes(rect, super::super::preferences_figure_data::paint_orbit_origin) { + if let egui::Shape::Rect(r) = shape.shape { + all.push(r.fill); + } + } + all + }; + let (light, dark) = (colours(false), colours(true)); + assert!(!light.is_empty() && light != dark); + crate::theme::set_dark(previous); + } + + #[test] + fn theme_thumbnails_paint_with_the_sample_colours_and_a_slanted_system_band() { + let (light, dark) = (ThemeSample::from_tokens(&Tokens::light()), ThemeSample::from_tokens(&Tokens::dark())); + assert_ne!(light, dark); + let rect = Rect::from_min_size(Pos2::new(4.0, 4.0), vec2(124.0, 76.0)); + for rect in rects().into_iter().chain([rect]) { + let _ = shapes(rect, |p, r| paint_theme_thumbnail(p, r, &light)); + let _ = shapes(rect, |p, r| paint_theme_system(p, r, &light, &dark)); + } + let single = shapes(rect, |p, r| paint_theme_thumbnail(p, r, &light)).len(); + let system = shapes(rect, |p, r| paint_theme_system(p, r, &light, &dark)).len(); + assert!(system > single, "the dark band adds shapes over the light card"); + for shape in shapes(rect, |p, r| paint_theme_system(p, r, &light, &dark)) { + let bounds = shape.shape.visual_bounding_rect().intersect(shape.clip_rect); + assert!(!bounds.is_positive() || rect.expand(1.0).contains_rect(bounds), "{bounds:?}"); + } + } } diff --git a/docs/ui-kit.md b/docs/ui-kit.md index 9e95888e0..f0f19882a 100644 --- a/docs/ui-kit.md +++ b/docs/ui-kit.md @@ -858,3 +858,52 @@ and its shared gap above an inline result toolbar. `number_pair` extends the shared value-pair row to bounded numeric fields (such as image width and height), preserving label alignment, clipping and number-field behavior. + +## Preferences cards, figures and help (redesign) + +The redesigned Preferences pages (tracker #9863, reference in `docs/design/preferences/`) compose +these shared pieces; the pages themselves arrive in later steps. Sizes follow +`docs/design/preferences/measurements.md`. + +| Element | Use | Main tokens | +| --- | --- | --- | +| `picture_card(ui, &Card, width)` | A radio card: a figure, a label, an optional sub-label, an optional "has options" disc (its text is the hover) and an optional accent check. The figure keeps its aspect ratio and fills the card's inside width; the card sizes to the `width` its container gives it (`card_width(available, columns, gap)` divides a row). Selected: 2 pt `form_primary` border, `selected_bg` fill, `selected_ink` semibold label. Disabled: dimmed, no hover, no click, no focus ring. Keyboard focus draws a ring outside the border. Reports `RadioButton` to accessibility. | `form_primary`, `selected_bg`, `selected_ink`, `hover`, `control_fill`, `dialog_border`, `form_ink`, `form_dim`, `on_accent`, `radius_lg`, `space_*`, `font_label/small` | +| `toggle_tile(ui, &Card, width)` | The same picture with a 15 pt checkbox in the top-right corner (`Card::selected` is "on"). Reports `Checkbox`. | as above, `control_border` | +| `preset_card(ui, name, word, selected, enabled, &icon, width)` | A 70 pt card with a 38 pt icon box (`icon` paints into it in the ink it is given), a name, one word and an accent check. Used for Performance, Quality and Custom. | as above, `pref_well` | +| `help_icon(ui, text)` | The (i) after a label. Shows `text` as a tooltip and exposes it as the widget's label. | `form_dim`, `form_ink` | +| `carousel(ui, id, count, item_width, item_height, item)` | A row of items between a previous and a next arrow (both labelled from the `prefs.carousel_*` messages). `carousel_window(count, offset, available, item_width, gap, arrow)` says which items show; the arrow at an end is dimmed (0.35) and inert. The first shown index is kept in the Ui's temporary memory under `id`. | `dialog_border`, `control_fill`, `hover`, `form_ink`, `radius_lg` | + +`card_look(selected, enabled, hovered, focused)` holds the state rules (border width, fill, ink, weight, +dimming, focus ring) apart from the painting so they can be tested. + +### Figures + +`ui_kit/preferences_figures.rs` paints the illustrations of the Preferences boards. The geometry of +each comes from its SVG in `docs/design/preferences/figures/`: `tools/preferences-figures/generate.py` +compiles those files into `ui_kit/preferences_figure_data.rs`, one constant and one painter per +figure (`paint_tess_normal`, `paint_orbit_origin`, ...; `FIGURES` lists them all), and +`preferences_figure_ops.rs` paints the operations with egui shapes. A figure is a list of rectangles, +circles, polygons, soft shadows and tiny captions in the figure's own coordinates. Nothing is +rasterised and no image is loaded; a figure costs a few dozen shapes and scales to any rectangle, +keeping its aspect ratio. A zero, tiny, huge or non-finite rectangle paints nothing or something +clipped, never panics. + +To change a figure, edit its SVG (light and dark) and run +`python3 tools/preferences-figures/generate.py`; never edit `preferences_figure_data.rs`. The colour +of each element is a role read from `Tokens`: `figure_ground`, `figure_line`, `figure_face_top`, +`figure_face_left`, `figure_face_right`, `figure_card`, `figure_accent`, `figure_reference`, +`figure_axis_x/y/z`, `figure_ok`, `figure_warn`, plus `form_ink`, `form_dim`, `dialog_border`, +`control_border` and `control_fill` (`docs/design/preferences/tokens.md`). The new tokens, with light +and dark values, are in `assets/styles/ui/palettes.rs`; theme files cannot override them yet and keep +the built-in values. The colour vision samples read `axis_z`, `sketch_projected`, `axis_x`, `bend_up` +and `bend_down`, so they follow the colour vision mode. + +Theme thumbnails (`paint_theme_thumbnail`, `paint_theme_system`) take a `ThemeSample` (12 colours, +`ThemeSample::from_tokens(&tokens)`), not the dialog's tokens, because a card shows its own theme. +The Orientation figures and the visual-style icon are not repeated here: the app already has them. + +New pieces and figures each have an entry in `gallery::ELEMENTS` (`picture_card`, `toggle_tile`, +`preset_card`, `help_icon`, `carousel`, `preference_theme_thumbnails`, `preference_figures`), checked +in both themes. `SOLIDCRAFT_PREFERENCE_WIDGET_EVIDENCE=

` keeps the CPU-rendered boards +(`preferences-widgets-*.png`, `preferences-figures-*.png`) from +`preference_widgets_and_figures_board_in_both_themes`. diff --git a/tools/preferences-figures/generate.py b/tools/preferences-figures/generate.py new file mode 100644 index 000000000..b45bd392e --- /dev/null +++ b/tools/preferences-figures/generate.py @@ -0,0 +1,588 @@ +#!/usr/bin/env python3 +"""Compile docs/design/preferences/figures/*.svg into ui_kit/preferences_figure_data.rs. + +Each figure becomes a list of drawing operations (rectangles, circles, flattened polygons, text) in +the figure's own coordinates, with colours as roles (`Ink`) instead of hex values. A role is the +light/dark colour pair the board used at that position; docs/design/preferences/tokens.md says which +`theme::Tokens` field each role reads. Run from the repository root: + + python3 tools/preferences-figures/generate.py +""" +import collections +import json +import math +import os +import re +import sys +import xml.etree.ElementTree as ET + +ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) +FIGS = os.path.join(ROOT, 'docs/design/preferences/figures') +OUT = os.path.join(ROOT, 'crates/ui-egui/src/ui_kit/preferences_figure_data.rs') + +# Skipped: the Orientation figures already exist in ui_kit and stay as they are. +SKIP = {'orientation-z-up', 'orientation-y-up', 'style-shaded-edges'} +THEMES = ['theme-light', 'theme-dark', 'theme-gruvbox', 'theme-imported'] + +PAIRS = { + ('#F7F8FA', '#1C1F26'): 'Ground', + ('#6F7C8F', '#A3AEC2'): 'Line', + ('#236EAD', '#8CBEF5'): 'Accent', + ('#FFFFFF', '#6B7790'): 'Top', + ('#4A5868', '#B4BBC8'): 'Dim', + ('#E4E9F0', '#515B72'): 'Left', + ('#C9D2DE', '#394256'): 'Right', + ('#D5DBE3', '#3F4552'): 'Border', + ('#C3CBD6', '#4A5262'): 'ControlBorder', + ('#FFFFFF', '#2F343E'): 'Card', + ('#1B2430', '#DEE2E8'): 'Text', + ('#8A5300', '#E8C24A'): 'Reference', + ('#2F6FD0', '#6CA8F7'): 'AxisZ', + ('#D64545', '#F27A7A'): 'AxisX', + ('#2E9E5B', '#62D48E'): 'AxisY', + ('#FFFFFF', '#FFFFFF'): 'White', + ('#B84A00', '#F0A27A'): 'Note', + ('#FBEBDD', '#4A3326'): 'NoteFill', + ('#2F7D5B', '#7FD1AE'): 'Ok', + ('#C98A00', '#E8C24A'): 'Warn', + ('#FFFFFF', '#1C1F26'): 'Control', + ('#0072B2', '#56B4E9'): 'Cv0', + ('#E69F00', '#F0C060'): 'Cv1', + ('#E69F00', '#E69F00'): 'Cv1', + ('#D55E00', '#F0A27A'): 'Cv2', + ('#56B4E9', '#8CBEF5'): 'Cv3', + ('#56B4E9', '#56B4E9'): 'Cv3', + ('#CC79A7', '#CC79A7'): 'Cv4', +} + + +def num(v, d=0.0): + return d if v is None else float(re.match(r'-?[\d.]+(?:e-?\d+)?', v.strip()).group(0)) + + +def parse_color(v): + """(hex6 upper, alpha) or None for none/url.""" + if v is None or v == 'none': + return None + v = v.strip() + if v.startswith('url('): + return ('url', re.search(r'#([\w-]+)', v).group(1)) + m = re.fullmatch(r'#([0-9A-Fa-f]{3,8})', v) + if not m: + raise ValueError(v) + h = m.group(1) + if len(h) == 3: + h = ''.join(c * 2 for c in h) + a = 1.0 + if len(h) == 8: + a = int(h[6:], 16) / 255.0 + h = h[:6] + return ('#' + h.upper(), a) + + +def mat_mul(a, b): + return (a[0] * b[0] + a[2] * b[1], a[1] * b[0] + a[3] * b[1], a[0] * b[2] + a[2] * b[3], a[1] * b[2] + a[3] * b[3], + a[0] * b[4] + a[2] * b[5] + a[4], a[1] * b[4] + a[3] * b[5] + a[5]) + + +def parse_transform(s): + m = (1, 0, 0, 1, 0, 0) + for name, args in re.findall(r'(\w+)\(([^)]*)\)', s or ''): + v = [float(x) for x in re.split(r'[ ,]+', args.strip())] + if name == 'translate': + t = (1, 0, 0, 1, v[0], v[1] if len(v) > 1 else 0) + elif name == 'scale': + t = (v[0], 0, 0, v[1] if len(v) > 1 else v[0], 0, 0) + elif name == 'matrix': + t = tuple(v) + else: + raise ValueError(name) + m = mat_mul(m, t) + return m + + +def ap(m, x, y): + return (m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]) + + +def flatten_path(d, m): + toks = re.findall(r'[MmLlHhVvZzAaQqCc]|-?[\d.]+(?:e-?\d+)?', d) + i = 0 + subs = [] + cur = None + x = y = sx = sy = 0.0 + cmd = None + + def nxt(): + nonlocal i + v = float(toks[i]) + i += 1 + return v + + def add(px, py): + cur.append(ap(m, px, py)) + + while i < len(toks): + if re.fullmatch(r'[A-Za-z]', toks[i]): + cmd = toks[i] + i += 1 + if cmd in 'Zz': + if cur: + subs.append((cur, True)) + cur = None + x, y = sx, sy + continue + c = cmd + if c in 'Mm': + if cur and len(cur) > 0: + subs.append((cur, False)) + nx, ny = nxt(), nxt() + if c == 'm': + nx, ny = x + nx, y + ny + x, y = sx, sy = nx, ny + cur = [] + add(x, y) + cmd = 'L' if c == 'M' else 'l' + elif c in 'Ll': + nx, ny = nxt(), nxt() + if c == 'l': + nx, ny = x + nx, y + ny + x, y = nx, ny + if cur is None: + cur = [] + add(sx, sy) + add(x, y) + elif c in 'Hh': + nx = nxt() + x = x + nx if c == 'h' else nx + if cur is None: + cur = [] + add(sx, sy) + add(x, y) + elif c in 'Vv': + ny = nxt() + y = y + ny if c == 'v' else ny + if cur is None: + cur = [] + add(sx, sy) + add(x, y) + elif c in 'Qq': + a, b, e, f = nxt(), nxt(), nxt(), nxt() + if c == 'q': + a, b, e, f = x + a, y + b, x + e, y + f + for k in range(1, 13): + t = k / 12 + add((1 - t) ** 2 * x + 2 * (1 - t) * t * a + t * t * e, (1 - t) ** 2 * y + 2 * (1 - t) * t * b + t * t * f) + x, y = e, f + elif c in 'Cc': + a, b, e, f, g, h = (nxt() for _ in range(6)) + if c == 'c': + a, b, e, f, g, h = x + a, y + b, x + e, y + f, x + g, y + h + for k in range(1, 17): + t = k / 16 + u = 1 - t + add(u ** 3 * x + 3 * u * u * t * a + 3 * u * t * t * e + t ** 3 * g, u ** 3 * y + 3 * u * u * t * b + 3 * u * t * t * f + t ** 3 * h) + x, y = g, h + elif c in 'Aa': + rx, ry, rot, la, sw, ex, ey = (nxt() for _ in range(7)) + if c == 'a': + ex, ey = x + ex, y + ey + pts = arc(x, y, rx, ry, rot, int(la), int(sw), ex, ey) + for px, py in pts: + add(px, py) + x, y = ex, ey + else: + raise ValueError(c) + if cur: + subs.append((cur, False)) + return subs + + +def arc(x1, y1, rx, ry, phi, fa, fs, x2, y2): + if rx == 0 or ry == 0: + return [(x2, y2)] + ph = math.radians(phi) + cp, sp = math.cos(ph), math.sin(ph) + dx, dy = (x1 - x2) / 2, (y1 - y2) / 2 + x1p, y1p = cp * dx + sp * dy, -sp * dx + cp * dy + rx, ry = abs(rx), abs(ry) + lam = x1p ** 2 / rx ** 2 + y1p ** 2 / ry ** 2 + if lam > 1: + rx *= math.sqrt(lam) + ry *= math.sqrt(lam) + num_ = rx ** 2 * ry ** 2 - rx ** 2 * y1p ** 2 - ry ** 2 * x1p ** 2 + den = rx ** 2 * y1p ** 2 + ry ** 2 * x1p ** 2 + co = math.sqrt(max(0, num_ / den)) * (-1 if fa == fs else 1) + cxp, cyp = co * rx * y1p / ry, -co * ry * x1p / rx + cx, cy = cp * cxp - sp * cyp + (x1 + x2) / 2, sp * cxp + cp * cyp + (y1 + y2) / 2 + + def ang(ux, uy, vx, vy): + a = math.atan2(ux * vy - uy * vx, ux * vx + uy * vy) + return a + + th1 = ang(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry) + dth = ang((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry) + if not fs and dth > 0: + dth -= 2 * math.pi + if fs and dth < 0: + dth += 2 * math.pi + n = max(6, int(abs(dth) / (math.pi / 16))) + out = [] + for k in range(1, n + 1): + t = th1 + dth * k / n + out.append((cp * rx * math.cos(t) - sp * ry * math.sin(t) + cx, sp * rx * math.cos(t) + cp * ry * math.sin(t) + cy)) + return out + + +def rr_poly(x, y, w, h, r, m, seg=6): + pts = [] + if r <= 0: + for px, py in ((x, y), (x + w, y), (x + w, y + h), (x, y + h)): + pts.append(ap(m, px, py)) + return pts + r = min(r, w / 2, h / 2) + for cx, cy, a0 in ((x + w - r, y + r, -90), (x + w - r, y + h - r, 0), (x + r, y + h - r, 90), (x + r, y + r, 180)): + for k in range(seg + 1): + a = math.radians(a0 + 90 * k / seg) + pts.append(ap(m, cx + r * math.cos(a), cy + r * math.sin(a))) + return pts + + +class Walker: + """Walks one SVG into a flat op list; colours stay as hex until paired.""" + + def __init__(self, root): + self.defs = {} + self.clips = {} + self.ops = [] + self.root = root + + @staticmethod + def tag(e): + return e.tag.split('}')[-1] + + def collect(self, e): + for c in e: + t = self.tag(c) + if t in ('linearGradient', 'radialGradient'): + self.defs[c.get('id')] = c + elif t == 'clipPath': + self.clips[c.get('id')] = c + elif t == 'defs': + self.collect(c) + else: + self.collect(c) + + def run(self): + self.collect(self.root) + vb = [float(v) for v in self.root.get('viewBox').split()] + self.size = (vb[2], vb[3]) + self.walk(self.root, (1, 0, 0, 1, -vb[0], -vb[1]), None, root=True) + return self.ops + + def style(self, e, mscale): + f = parse_color(e.get('fill', '#000000')) + s = parse_color(e.get('stroke')) + fo = num(e.get('fill-opacity'), 1.0) * num(e.get('opacity'), 1.0) + so = num(e.get('stroke-opacity'), 1.0) * num(e.get('opacity'), 1.0) + sw = num(e.get('stroke-width'), 1.0) * mscale if s else 0 + dash = None + if e.get('stroke-dasharray'): + dv = [float(v) for v in re.split(r'[ ,]+', e.get('stroke-dasharray').strip())] + if len(dv) >= 2 and dv[1] > 0: + dash = (dv[0] * mscale, dv[1] * mscale) + round_cap = e.get('stroke-linecap') == 'round' + return f, fo, s, so, sw, dash, round_cap + + def walk(self, e, m, clip, root=False): + for c in e: + t = self.tag(c) + if t in ('defs', 'linearGradient', 'radialGradient', 'clipPath', 'stop'): + continue + mc = m + if t == 'svg': + x, y = num(c.get('x'), 0), num(c.get('y'), 0) + w, h = num(c.get('width')), num(c.get('height')) + vb = [float(v) for v in c.get('viewBox').split()] + mc = mat_mul(m, (1, 0, 0, 1, x, y)) + mc = mat_mul(mc, (w / vb[2], 0, 0, h / vb[3], -vb[0] * w / vb[2], -vb[1] * h / vb[3])) + self.collect_clips(c) + # A nested svg clips its content to its own viewport. + self.ops.append(('clip', rr_poly(x, y, w, h, 0, m))) + self.walk(c, mc, clip) + self.ops.append(('unclip',)) + continue + if t == 'g': + mc = mat_mul(m, parse_transform(c.get('transform'))) + cl = clip + if c.get('clip-path'): + cid = re.search(r'#([\w-]+)', c.get('clip-path')).group(1) + cp = self.clips[cid] + pts = self.clip_points(cp, mc) + self.ops.append(('clip', pts)) + self.walk(c, mc, cl) + self.ops.append(('unclip',)) + else: + self.walk(c, mc, cl) + continue + if c.get('transform'): + mc = mat_mul(m, parse_transform(c.get('transform'))) + det = abs(mc[0] * mc[3] - mc[1] * mc[2]) + ms = math.sqrt(det) + f, fo, s, so, sw, dash, rc = self.style(c, ms) + axis = abs(mc[1]) < 1e-9 and abs(mc[2]) < 1e-9 + if t == 'rect': + x, y, w, h = num(c.get('x'), 0), num(c.get('y'), 0), num(c.get('width')), num(c.get('height')) + r = num(c.get('rx'), 0) + if f and f[0] == 'url' and f[1] in self.defs: + g = self.defs[f[1]] + stops = [(num(st.get('offset')), parse_color(st.get('stop-color'))[0]) for st in g] + self.ops.append(('poly', rr_poly(x, y, w, h, r, mc), True, ('grad', stops[0][1], stops[-1][1], ap(mc, 0, y)[1], ap(mc, 0, y + h)[1]), fo, s, so, sw, dash, rc)) + elif axis and mc[0] > 0 and mc[3] > 0: + p0 = ap(mc, x, y) + self.ops.append(('rect', p0[0], p0[1], w * mc[0], h * mc[3], r * mc[0], f, fo, s, so, sw, dash)) + else: + self.ops.append(('poly', rr_poly(x, y, w, h, r, mc), True, f and ('solid', f), fo, s, so, sw, dash, rc)) + elif t == 'circle': + cx, cy, r = num(c.get('cx')), num(c.get('cy')), num(c.get('r')) + if abs(mc[1]) < 1e-9 and abs(mc[2]) < 1e-9 and abs(mc[0] - mc[3]) < 1e-9: + p0 = ap(mc, cx, cy) + self.ops.append(('circle', p0[0], p0[1], r * mc[0], f, fo, s, so, sw, dash)) + else: + pts = [ap(mc, cx + r * math.cos(a * math.pi / 12), cy + r * math.sin(a * math.pi / 12)) for a in range(24)] + self.ops.append(('poly', pts, True, f and ('solid', f), fo, s, so, sw, dash, rc)) + elif t == 'ellipse': + cx, cy, rx, ry = num(c.get('cx')), num(c.get('cy')), num(c.get('rx')), num(c.get('ry')) + if f and f[0] == 'url': + g = self.defs[f[1]] + stops = [num(st.get('stop-opacity'), 1.0) for st in g] + p0 = ap(mc, cx, cy) + self.ops.append(('glow', p0[0], p0[1], rx * mc[0], ry * mc[3], stops[0] * fo)) + else: + pts = [ap(mc, cx + rx * math.cos(a * math.pi / 16), cy + ry * math.sin(a * math.pi / 16)) for a in range(32)] + self.ops.append(('poly', pts, True, f and ('solid', f), fo, s, so, sw, dash, rc)) + elif t in ('polygon', 'polyline'): + nums = [float(v) for v in re.split(r'[ ,]+', c.get('points').strip())] + pts = [ap(mc, nums[k], nums[k + 1]) for k in range(0, len(nums), 2)] + self.ops.append(('poly', pts, t == 'polygon', f and ('solid', f), fo, s, so, sw, dash, rc)) + elif t == 'path' and s and s[0] == 'url': + g = self.defs[s[1]] + stops = [(num(st.get('offset')), parse_color(st.get('stop-color')), num(st.get('stop-opacity'), 1.0)) for st in g] + for pts, closed in flatten_path(c.get('d'), mc): + (x0, y0), (x1, y1) = pts[0], pts[-1] + n = 10 + for k in range(n): + a0, a1 = k / n, (k + 1) / n + am = (a0 + a1) / 2 + al = stops[0][2] + (stops[-1][2] - stops[0][2]) * am + seg = [(x0 + (x1 - x0) * a0, y0 + (y1 - y0) * a0), (x0 + (x1 - x0) * a1, y0 + (y1 - y0) * a1)] + self.ops.append(('poly', seg, False, None, 1.0, stops[0][1], al, sw, None, rc)) + elif t == 'path': + for pts, closed in flatten_path(c.get('d'), mc): + if len(pts) >= 2: + fill = f and ('solid', f) if (closed or len(pts) >= 3) else None + self.ops.append(('poly', pts, closed, fill, fo, s, so, sw, dash, rc)) + elif t == 'text': + x, y = num(c.get('x')), num(c.get('y')) + p0 = ap(mc, x, y) + self.ops.append(('text', p0[0], p0[1], num(c.get('font-size')) * ms, c.get('text-anchor', 'start'), f, fo, ''.join(c.itertext()), num(c.get('font-weight'), 400) >= 600)) + elif t == 'g': + pass + else: + raise ValueError('unhandled ' + t) + + def collect_clips(self, e): + for c in e: + if self.tag(c) == 'clipPath': + self.clips[c.get('id')] = c + + def clip_points(self, cp, m): + out = [] + for c in cp: + t = self.tag(c) + if t == 'path': + for pts, _ in flatten_path(c.get('d'), m): + out.extend(pts) + elif t == 'rect': + out.extend(rr_poly(num(c.get('x'), 0), num(c.get('y'), 0), num(c.get('width')), num(c.get('height')), 0, m)) + else: + raise ValueError('clip ' + t) + return out + + +def load(name, theme): + tree = ET.parse(os.path.join(FIGS, '%s.%s.svg' % (name, theme))) + w = Walker(tree.getroot()) + return w.run(), w.size + + +def color_fields(op): + """Positions of (colour, alpha) tuples in an op, as (index) list.""" + k = op[0] + if k == 'rect': + return [6, 9] + if k == 'circle': + return [4, 7] + if k == 'poly': + return [None, 5] + if k == 'text': + return [5] + return [] + + +def ink_of(l, d, slots=None): + if slots is not None: + key = tuple(slots) + if key not in SLOTS: + SLOTS[key] = len(SLOTS) + return 'Slot(%d)' % SLOTS[key] + if l == '#000000': + return 'Black' + r = PAIRS.get((l, d)) + if r is None: + raise KeyError((l, d)) + return r + + +SLOTS = collections.OrderedDict() + + +def f32(v): + s = ('%.3f' % v).rstrip('0').rstrip('.') + if s in ('', '-0'): + s = '0' + return s + ('' if '.' in s else '.0') + + +def paint(l, d, alpha, slots=None): + """Option source.""" + if l is None: + return 'None' + return 'Some(P { ink: Ink::%s, a: %s })' % (ink_of(l[0], d[0], slots), f32(alpha)) + + +def line(sl, sd, so, sw, dash, rc, slots=None): + if sl is None or sw <= 0: + return 'None' + ds = dash or (0, 0) + return 'Some(L { ink: Ink::%s, a: %s, w: %s, dash: [%s, %s], round: %s })' % (ink_of(sl[0], sd[0], slots), f32(so), f32(sw), f32(ds[0]), f32(ds[1]), 'true' if rc else 'false') + + +def emit(name, ops_l, ops_d, slotsets=None): + out = [] + assert len(ops_l) == len(ops_d), (name, len(ops_l), len(ops_d)) + for idx, (a, b) in enumerate(zip(ops_l, ops_d)): + assert a[0] == b[0], (name, idx, a[0], b[0]) + sl = None + if slotsets is not None: + sl = [s[idx] for s in slotsets] + k = a[0] + if k == 'rect': + _, x, y, w, h, r, f, fo, s, so, sw, dash = a + _, _, _, _, _, _, fd, _, sd, _, _, _ = b + fs = fsl = None + if slotsets is not None: + fs = [t[6][0] if t[6] else None for t in sl] + ss = [t[8][0] if t[8] else None for t in sl] + out.append('Op::Rect { r: [%s, %s, %s, %s], radius: %s, fill: %s, line: %s }' % ( + f32(x), f32(y), f32(w), f32(h), f32(r), + paint(f, fd, fo, fs if slotsets is not None and f else None), + line(s, sd, so, sw, dash, False, ss if slotsets is not None and s else None))) + elif k == 'circle': + _, x, y, r, f, fo, s, so, sw, dash = a + fd, sd = b[4], b[6] + fs = ss = None + if slotsets is not None: + fs = [t[4][0] if t[4] else None for t in sl] + ss = [t[6][0] if t[6] else None for t in sl] + out.append('Op::Circle { c: [%s, %s, %s], fill: %s, line: %s }' % ( + f32(x), f32(y), f32(r), paint(f, fd, fo, fs if f and slotsets is not None else None), + line(s, sd, so, sw, dash, False, ss if s and slotsets is not None else None))) + elif k == 'poly': + _, pts, closed, fill, fo, s, so, sw, dash, rc = a + fd, sd = b[3], b[5] + pts_s = ', '.join('[%s, %s]' % (f32(px), f32(py)) for px, py in pts) + fs = ss = None + if slotsets is not None: + fs = [t[3][1][0] if t[3] and t[3][0] == 'solid' else None for t in sl] + ss = [t[5][0] if t[5] else None for t in sl] + grad = 'None' + fill_s = 'None' + if fill and fill[0] == 'grad': + _, top, bot, y0, y1 = fill + gd = b[3] + if slotsets is not None: + tops = [t[3][1] for t in sl] + bots = [t[3][2] for t in sl] + grad = 'Some(G { top: Ink::%s, bottom: Ink::%s, y: [%s, %s] })' % (ink_of(top, gd[1], tops), ink_of(bot, gd[2], bots), f32(y0), f32(y1)) + else: + grad = 'Some(G { top: Ink::%s, bottom: Ink::%s, y: [%s, %s] })' % (ink_of(top, gd[1]), ink_of(bot, gd[2]), f32(y0), f32(y1)) + elif fill: + fill_s = paint(fill[1], fd[1], fo, fs if slotsets is not None else None) + out.append('Op::Poly { pts: &[%s], closed: %s, fill: %s, grad: %s, line: %s }' % ( + pts_s, 'true' if closed else 'false', fill_s, grad, + line(s, sd, so, sw, dash, rc, ss if s and slotsets is not None else None))) + elif k == 'glow': + _, x, y, rx, ry, al = a + out.append('Op::Glow { c: [%s, %s, %s, %s], a: %s }' % (f32(x), f32(y), f32(rx), f32(ry), f32(al))) + elif k == 'text': + _, x, y, size, anchor, f, fo, txt, bold = a + fd = b[5] + fs = [t[5][0] for t in sl] if slotsets is not None else None + out.append('Op::Text { at: [%s, %s], size: %s, anchor: %d, ink: Ink::%s, a: %s, s: %s, bold: %s }' % ( + f32(x), f32(y), f32(size), {'start': 0, 'middle': 1, 'end': 2}[anchor], ink_of(f[0], fd[0], fs), f32(fo), '"' + txt.replace('\\', '\\\\').replace('"', '\\"') + '"', 'true' if bold else 'false')) + elif k == 'clip': + pts_s = ', '.join('[%s, %s]' % (f32(px), f32(py)) for px, py in a[1]) + out.append('Op::Clip(&[%s])' % pts_s) + elif k == 'unclip': + out.append('Op::Unclip') + else: + raise ValueError(k) + return out + + +def const_name(n): + return n.upper().replace('-', '_') + + +def fn_name(n): + return 'paint_' + n.replace('-', '_') + + +def main(): + man = sorted({f.split('.')[0] for f in os.listdir(FIGS) if f.endswith('.svg')}) + parts = [] + parts.append('//! Generated by `tools/preferences-figures/generate.py` from `docs/design/preferences/figures/*.svg`.\n' + '//! Do not edit by hand: change the SVG and run the script again.\n' + '#![allow(clippy::approx_constant, clippy::excessive_precision)]\n' + 'use super::preferences_figure_ops::{Figure, G, Ink, L, Op, P};\n') + fns = [] + names = [] + for name in man: + if name in SKIP or name.startswith('theme-'): + continue + ol, size = load(name, 'light') + od, size2 = load(name, 'dark') + assert size == size2 + ops = emit(name, ol, od) + parts.append('pub(super) const %s: Figure = Figure { size: [%s, %s], ops: &[\n %s,\n] };\n' % (const_name(name), f32(size[0]), f32(size[1]), ',\n '.join(ops))) + names.append(name) + # theme thumbnail: slots from the four themes + loaded = [load(t, 'light')[0] for t in THEMES] + size = load('theme-light', 'light')[1] + ops = emit('theme-thumbnail', loaded[0], loaded[0], slotsets=loaded) + parts.append('pub(super) const THEME_THUMBNAIL: Figure = Figure { size: [%s, %s], ops: &[\n %s,\n] };\n' % (f32(size[0]), f32(size[1]), ',\n '.join(ops))) + slot_table = ['// Theme thumbnail slots (light, dark, gruvbox, imported sample colours):'] + for key, i in SLOTS.items(): + slot_table.append('// %d: %s' % (i, ' '.join(str(k) for k in key))) + parts.append('\n'.join(slot_table) + '\n') + parts.append('use egui::{Painter, Rect};\nuse super::preferences_figure_ops::paint;\n') + for n in names: + parts.append('/// The `%s` figure of `docs/design/preferences/figures`.\npub(crate) fn %s(p: &Painter, rect: Rect) {\n paint(p, rect, &%s, None, None);\n}\n' % (n, fn_name(n), const_name(n))) + parts.append('/// Every figure painter by file name, for the gallery and the tests.\npub(crate) const FIGURES: &[(&str, [f32; 2], fn(&Painter, Rect))] = &[\n%s];\n' % ''.join(' ("%s", %s.size, %s),\n' % (n, const_name(n), fn_name(n)) for n in names)) + open(OUT, 'w', encoding='utf8', newline='\n').write('\n'.join(parts)) + print('figures', len(names), 'slots', len(SLOTS), file=sys.stderr) + + +if __name__ == '__main__': + main()