diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b8f83..d50b47f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 1.8.2 + +### New + +- **Audience screen settings** (Settings > Audience screen, also under Present > Audience screen). **Detect displays automatically** (on at first) finds a projector or TV plugged in or out while TeXora is open, and **Look every** sets how often, from 1 to 30 seconds; **Look for displays now** checks at once. When the slide's shape differs from the screen's, **Fit** shows the whole slide with bands at the sides, **Fill** covers the screen and trims the slide's edges, and **Stretch** stretches the slide to the screen. **High resolution** (on at first) draws the slide with the screen's own pixels, up to 4K. + +### Fixed + +- **A projector or TV plugged in while TeXora is open is now found.** Before, TeXora only saw the displays connected when it started; it now makes a newly connected display the audience screen and says so, and notices one being unplugged. +- **The teleprompter no longer lingers between slides.** When a slide's notes end, the script moves quickly past the blank space and the next slide's heading to the next slide's first line, then goes on at the reading speed, so the reading band never waits on empty space. The space between slides is also smaller. **Band follows lines** (off at first) puts the band on the line being read, gliding from line to line, instead of at a fixed reading line. +- **The current slide in the presenter view is again at least as large as its automatic fit.** A divider saved earlier, or in another window size, could leave the current slide smaller than the next one; it now fills its column and grows with the window. + ## 1.8.1 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 73bbeeb..4b86ebb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3335,7 +3335,7 @@ dependencies = [ [[package]] name = "texora" -version = "1.8.1" +version = "1.8.2" dependencies = [ "avif-decode", "dirs", diff --git a/Cargo.toml b/Cargo.toml index 1d32bc8..4686c2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "texora" -version = "1.8.1" +version = "1.8.2" edition = "2021" description = "TeXora: a LaTeX-native presenter for Beamer and PDF slides" license = "PolyForm-Noncommercial-1.0.0" diff --git a/README.md b/README.md index e64a998..8f90efb 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,14 @@ Drag the dividers to resize panels; **View > Fit all panels automatically** rese ### Audience window - **F5** opens the audience window, fullscreen on a second display; on a single display, **F11** - makes it fullscreen. + makes it fullscreen. A projector or TV plugged in while TeXora is open is found within a few + seconds; **Present > Audience screen** lists the displays. +- **Settings > Audience screen** (also under **Present > Audience screen**): **Detect displays + automatically** and how often to look; **Fit** (the whole slide, bands at the sides), **Fill** (the + whole screen, slide edges trimmed) or **Stretch** when the slide's shape differs from the screen's; + and **High resolution**, the screen's own pixels up to 4K. +- A 4:3 slide on a 16:9 TV shows bands with **Fit**. For slides that fill a widescreen display, use + `\documentclass[aspectratio=169]{beamer}`. - **B** blanks the screen, **W** shows a whiteboard, **F** freezes the audience view. - Ink, the laser pointer and zoom appear on the audience screen as they are used. @@ -240,7 +247,9 @@ with **View > Teleprompter**, or with **K**, which also starts it. | **Dark** | Light text on a dark background; click again for dark text on light | | | **Background**, **Text** | Pick any colours; remembered | | -A band marks the reading line. Moving to another slide brings its notes to the reading line. The +A band marks the reading line; between slides the script moves quickly past the blank space to the +next slide's first line. **Band follows lines** puts the band on the line being read instead. Moving to another slide brings its notes +to the reading line. The wheel, or **Down** and **Up**, move the script by hand, and Cmd/Ctrl with the wheel changes the text size. The notes come from the source, the `.note.md` file or the text of Beamer notes pages. diff --git a/src/app.rs b/src/app.rs index 11beee0..d4b11e1 100644 --- a/src/app.rs +++ b/src/app.rs @@ -31,6 +31,8 @@ pub const PALETTE: [[u8; 3]; 6] = [[214, 40, 40], [240, 150, 20], [240, 210, 40], [40, 160, 70], [30, 110, 220], [170, 60, 200]]; const MAX_RENDER_WIDTH: u32 = 3000; +/// The widest the audience screen's slide is drawn in high resolution (a 4K display). +const AUDIENCE_MAX_WIDTH: u32 = 4096; pub const SAMPLE_TEX: &str = include_str!("../assets/sample/texora-sample.tex"); pub const SAMPLE_PDF: &[u8] = include_bytes!("../assets/sample/texora-sample.pdf"); const SAMPLE_NAV: &str = include_str!("../assets/sample/texora-sample.nav"); @@ -275,6 +277,8 @@ pub struct App { pub audience_age: u32, pub displays: Vec, pub display: usize, + /// When the displays were last looked at. + pub displays_checked: Instant, pub src: Option, pub compiling: bool, @@ -329,6 +333,10 @@ pub struct App { pub prompter_target: Option, pub prompter_seek: Option, pub prompter_nudge: f32, + /// The script's lines of text, as last drawn (top and bottom, in script units), and where the + /// reading band is (its middle and height), gliding from line to line. + pub prompter_rows: Vec<(f32, f32)>, + pub prompter_band: Option<(f32, f32)>, pub sync_mark: Option<(usize, [f32; 2], Instant)>, /// Animations in the PDF (the animate package): where each one is in its play, by (page, number). pub anim_play: HashMap<(usize, usize), AnimPlay>, @@ -492,6 +500,7 @@ impl App { audience_age: 0, displays, display, + displays_checked: Instant::now(), src: None, compiling: false, compile_again: false, @@ -528,6 +537,8 @@ impl App { prompter_target: None, prompter_seek: None, prompter_nudge: 0.0, + prompter_rows: vec![], + prompter_band: None, sync_mark: None, anim_play: HashMap::new(), anim_cache: HashMap::new(), @@ -1036,8 +1047,47 @@ impl App { // ---------- every frame ---------- + /// Looks again at the connected displays, so a projector or TV plugged in (or out) while + /// TeXora is open is found without restarting it. The chosen audience display stays chosen while + /// it is connected; a newly connected second display becomes the audience display. + /// Settings > Audience screen turns this off, and sets how often it looks. + fn refresh_displays(&mut self, ctx: &Context) { + if !self.st.detect_displays { + return; + } + let every = std::time::Duration::from_secs_f32(self.st.display_check_secs.clamp(1.0, 30.0)); + ctx.request_repaint_after(every); + if self.displays_checked.elapsed() >= every { + self.look_for_displays(); + } + } + + /// Reads the connected displays now (also **Present > Audience screen > Look for displays now**). + pub fn look_for_displays(&mut self) { + self.displays_checked = Instant::now(); + let Ok(now) = display_info::DisplayInfo::all() else { return }; + let ids = |l: &[display_info::DisplayInfo]| l.iter().map(|d| (d.id, d.x, d.y, d.width, d.height)).collect::>(); + if now.is_empty() || ids(&now) == ids(&self.displays) { + return; + } + let chosen = self.displays.get(self.display).map(|d| d.id); + let before = self.displays.len(); + self.display = chosen + .and_then(|id| now.iter().position(|d| d.id == id && (now.len() < 2 || !d.is_primary))) + .or_else(|| now.iter().position(|d| !d.is_primary)) + .unwrap_or(0); + let name = |d: &display_info::DisplayInfo| if d.friendly_name.is_empty() { "a display".to_string() } else { d.friendly_name.clone() }; + if now.len() > before && now.len() >= 2 { + self.status = format!("{} connected: the slides will show there. Press F5 to present.", name(&now[self.display])); + } else if now.len() < before { + self.status = if now.len() < 2 { "Second display disconnected. Press F11 for fullscreen slides.".to_string() } else { "A display was disconnected.".to_string() }; + } + self.displays = now; + } + pub fn pump(&mut self, ctx: &Context) { self.tick += 1; + self.refresh_displays(ctx); // The audience window is drawn from this one, and macOS stops drawing a hidden window, as // it does behind a fullscreen slide on one screen. A talk must not freeze because of that. // This request lasts one frame, so it is sent every frame. @@ -1345,11 +1395,17 @@ impl App { pub fn texture(&mut self, page: usize, region: Region, want: u32) -> Option { // Sizes come in steps, and a page is never rendered larger than is useful, so zooming // reuses pictures instead of queueing a new huge one for every small change. - let want = match want { - 0..=1600 => want.max(64).div_ceil(32) * 32, - 1601..=2000 => 2000, - 2001..=2500 => 2500, - _ => MAX_RENDER_WIDTH, + // The audience screen in high resolution gets the width it really shows, up to 4K, so text + // stays sharp on a large display. + let want = if self.painting_audience && self.st.audience_hires { + want.clamp(64, AUDIENCE_MAX_WIDTH).div_ceil(64) * 64 + } else { + match want { + 0..=1600 => want.max(64).div_ceil(32) * 32, + 1601..=2000 => 2000, + 2001..=2500 => 2500, + _ => MAX_RENDER_WIDTH, + } }; let settling = self.zoom_changed.elapsed().as_secs_f32() < 0.18; let tick = self.tick; diff --git a/src/settings.rs b/src/settings.rs index 5b46c39..53b7b9a 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -259,6 +259,30 @@ pub fn add_new_actions(keys: &mut Vec<(Action, Vec)>) { } } +/// How a slide takes the audience screen when their shapes differ (a 4:3 slide on a 16:9 TV, a +/// wide slide on a tall screen). +#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] +pub enum AudienceFit { + /// The whole slide, as large as fits; bands fill the rest of the screen. + #[default] + Fit, + /// The screen filled, keeping the slide's shape; the slide's edges are cut off. + Fill, + /// The screen filled by stretching the slide to its shape. + Stretch, +} + +impl AudienceFit { + pub const ALL: [AudienceFit; 3] = [AudienceFit::Fit, AudienceFit::Fill, AudienceFit::Stretch]; + pub fn label(self) -> &'static str { + match self { + AudienceFit::Fit => "Fit: the whole slide, bands at the sides", + AudienceFit::Fill => "Fill: the whole screen, slide edges trimmed", + AudienceFit::Stretch => "Stretch: the whole screen, slide stretched", + } + } +} + /// The teleprompter's two looks, as (background, text): dark text on light, and light text on dark. pub const PROMPTER_LIGHT: ([u8; 3], [u8; 3]) = ([252, 251, 249], [20, 20, 20]); pub const PROMPTER_DARK: ([u8; 3], [u8; 3]) = ([18, 18, 20], [236, 235, 230]); @@ -295,6 +319,9 @@ pub struct Settings { pub prompter_speed: f32, /// When the teleprompter's script reaches the next slide's notes, that slide comes on show. pub prompter_follow: bool, + /// The teleprompter's band sits on the line being read and glides from line to line, instead of + /// staying at the reading line. + pub prompter_band_lines: bool, /// The teleprompter's background and text colours (light by default; Dark swaps them). pub prompter_bg: [u8; 3], pub prompter_fg: [u8; 3], @@ -312,6 +339,13 @@ pub struct Settings { pub vlc_path: String, /// Videos play their sound (through ffplay, which comes with ffmpeg). pub video_sound: bool, + /// Look for displays plugged in or out while the app is open, every `display_check_secs`. + pub detect_displays: bool, + pub display_check_secs: f32, + /// How the slide takes the audience screen, and whether it is drawn at the screen's full + /// resolution (up to 4K). + pub audience_fit: AudienceFit, + pub audience_hires: bool, /// Look for a newer version when TeXora starts. pub check_updates: bool, /// A newer version the speaker chose to skip: its update notice is not shown again. @@ -334,6 +368,7 @@ impl Default for Settings { notes_size: 26.0, prompter_speed: 4.0, prompter_follow: true, + prompter_band_lines: false, prompter_bg: PROMPTER_LIGHT.0, prompter_fg: PROMPTER_LIGHT.1, notes_in_tex: true, @@ -343,6 +378,10 @@ impl Default for Settings { ffmpeg_path: String::new(), vlc_path: String::new(), video_sound: true, + detect_displays: true, + display_check_secs: 2.0, + audience_fit: AudienceFit::Fit, + audience_hires: true, check_updates: true, skipped_update: String::new(), last_template: String::new(), diff --git a/src/ui_chrome.rs b/src/ui_chrome.rs index d35c813..2e2b715 100644 --- a/src/ui_chrome.rs +++ b/src/ui_chrome.rs @@ -851,6 +851,8 @@ impl App { for (i, n) in names.into_iter().enumerate() { ui.radio_value(&mut self.display, i, n); } + ui.separator(); + self.audience_settings(ui); }); ui.separator(); self.item(ui, "Black screen", Action::Blackout); diff --git a/src/ui_panels.rs b/src/ui_panels.rs index 12d84aa..f366cb0 100644 --- a/src/ui_panels.rs +++ b/src/ui_panels.rs @@ -282,6 +282,36 @@ impl App { }); } + /// Settings > Audience screen: finding displays, and how the slide takes the screen. + pub fn audience_settings(&mut self, ui: &mut Ui) { + let mut changed = false; + changed |= ui.checkbox(&mut self.st.detect_displays, "Detect displays automatically").on_hover_text("Finds a projector or TV plugged in, or out, while the app is open").changed(); + ui.add_enabled_ui(self.st.detect_displays, |ui| { + ui.horizontal(|ui| { + ui.label("Look every"); + changed |= ui.add(Slider::new(&mut self.st.display_check_secs, 1.0..=30.0).step_by(1.0).suffix(" s")).changed(); + }); + }); + if ui.button("Look for displays now").clicked() { + self.look_for_displays(); + if self.status.is_empty() { + self.status = format!("{} display{} found.", self.displays.len(), if self.displays.len() == 1 { "" } else { "s" }); + } + } + ui.add_space(6.0); + ui.label(RichText::new("When the slide's shape differs from the screen's (a 4:3 slide on a 16:9 TV):").size(12.5).color(MUTED)); + for f in crate::settings::AudienceFit::ALL { + changed |= ui.radio_value(&mut self.st.audience_fit, f, f.label()).changed(); + } + changed |= ui + .checkbox(&mut self.st.audience_hires, "High resolution (the screen's own pixels, up to 4K)") + .on_hover_text("Sharper text on large displays; uses more memory") + .changed(); + if changed { + self.save_layout(); + } + } + fn settings_tab(&mut self, ui: &mut Ui) { ScrollArea::vertical().auto_shrink([false, true]).show(ui, |ui| { ui.label(RichText::new("Click a heading to open or close its section.").size(12.0).color(MUTED)); @@ -316,6 +346,7 @@ impl App { let force = std::mem::take(&mut self.show_packages).then_some(true); ui.add_space(4.0); CollapsingHeader::new(strong("Required LaTeX packages", 14.5)).id_salt(("settings", "Required LaTeX packages")).default_open(false).open(force).show(ui, |ui| self.required_packages(ui)); + group(ui, "Audience screen", false, &mut |ui| self.audience_settings(ui)); group(ui, "Video", false, &mut |ui| self.video_settings(ui)); group(ui, "Speaker notes", false, &mut |ui| { // A LaTeX presentation keeps its notes in the source, as \note{} in each slide. diff --git a/src/ui_present.rs b/src/ui_present.rs index ffd43e3..9f8a094 100644 --- a/src/ui_present.rs +++ b/src/ui_present.rs @@ -98,6 +98,21 @@ pub fn sid(name: &str) -> Id { } /// Largest rectangle of this shape inside `r`; at the top, or centred. +/// Where the slide goes on the audience screen `full`: the whole slide (Fit), covering the screen +/// with the slide's edges beyond it (Fill), or the screen's own shape (Stretch). +pub fn audience_rect(full: Rect, aspect: f32, how: crate::settings::AudienceFit) -> Rect { + use crate::settings::AudienceFit; + let aspect = aspect.max(0.1); + match how { + AudienceFit::Fit => fit(full, aspect, false), + AudienceFit::Stretch => full, + AudienceFit::Fill => { + let w = full.width().max(full.height() * aspect); + Rect::from_center_size(full.center(), vec2(w, w / aspect)) + } + } +} + pub fn fit(r: Rect, aspect: f32, top: bool) -> Rect { let w = r.width().min(r.height() * aspect); let h = w / aspect; @@ -680,7 +695,14 @@ impl App { None => (1.0 - (next_fit + gap) / col.height().max(1.0)).clamp(0.3, 0.7), } } else { current_row(col.width(), col.height(), aspect, label + 34.0, gap) }; - let row_share = (if large { self.st.layout.large_row } else { self.st.layout.presenter_row }).unwrap_or(auto_row); + // The current slide never gets smaller than its automatic fit: a divider saved in another + // window size, or dragged too far, would otherwise leave it smaller than the next slide. + // Dragging the divider down still makes it larger. + let row_share = if large { + self.st.layout.large_row.unwrap_or(auto_row) + } else { + self.st.layout.presenter_row.map_or(auto_row, |s| s.max(auto_row)) + }; let mid = col.top() + col.height() * row_share; let top_box = Rect::from_min_max(col.min, pos2(col.right(), mid - gap / 2.0)); let next_box = Rect::from_min_max(pos2(col.left(), mid + gap / 2.0), col.max); @@ -1228,7 +1250,17 @@ impl App { ui.ctx().request_repaint(); } else if self.prompter_on { // Speed 1 to 10: about a line every four seconds to more than two lines a second. - offset += self.st.prompter_speed * size * 0.08 * dt; + let step = self.st.prompter_speed * size * 0.08 * dt; + // Between slides (the space after a note, the next slide's heading) there is nothing to + // read: the script glides quickly to the next line of text and slows to the reading + // speed as it arrives, so the band never waits on empty space. + let at = offset + line * 0.5; + let in_text = self.prompter_rows.iter().any(|r| r.0 - 2.0 <= at && at <= r.1 + 2.0); + let next = self.prompter_rows.iter().find(|r| r.0 > at).map(|r| r.0); + offset += match (in_text, next) { + (false, Some(n)) => step + (n - at - 1.0).max(0.0) * (dt * 6.0).min(1.0), + _ => step, + }; ui.ctx().request_repaint(); read_on = true; } @@ -1250,6 +1282,7 @@ impl App { ui.painter().rect_filled(Rect::from_min_max(rect.min, pos2(rect.right(), bar.top() - 2.0)), 8.0 * k, bg); let texts: Vec<(String, Option)> = (0..self.deck.frames.len()).map(|f| (self.deck.frames[f].title.clone(), self.prompter_text(f))).collect(); let mut marks: Vec<(usize, f32)> = vec![]; + let mut rows: Vec<(f32, f32)> = vec![]; let mut child = ui.new_child(UiBuilder::new().max_rect(view)); child.set_clip_rect(view.intersect(ui.clip_rect())); let out = ScrollArea::vertical() @@ -1272,13 +1305,14 @@ impl App { marks.push((f, ui.cursor().top() - top - lead)); match text { Some(t) => { - markdown_rows_in(ui, t, size, custom.then_some(fg)); + // Each line of text, in the same units as the scroll offset. + rows.extend(markdown_rows_in(ui, t, size, custom.then_some(fg)).iter().map(|r| (r.top() - top - lead, r.bottom() - top - lead))); } None => { ui.label(RichText::new("No notes for this slide.").size((size * 0.6).max(11.0)).italics().color(soft)); } } - ui.add_space(size * 1.1); + ui.add_space(size * 0.8); } ui.add_space((view.height() - read_y).max(0.0)); }); @@ -1328,9 +1362,39 @@ impl App { mesh.add_triangle(0, 2, 3); ui.painter().add(Shape::mesh(mesh)); } - // The reading line: a soft band across, with a mark at each end. + // The reading band sits on the line being read (or, between slides, the next one coming) and + // glides from line to line, so it always marks words, never empty space. + let at = offset + line * 0.5; + let target = rows + .iter() + .find(|r| r.0 - 2.0 <= at && at <= r.1 + 2.0) + .or_else(|| rows.iter().find(|r| r.0 > at)) + .or(rows.last()) + .map(|r| ((r.0 + r.1) / 2.0, (r.1 - r.0).max(line * 0.6))) + .unwrap_or((at, line)); + let band_now = match self.prompter_band { + Some((c, h)) if (c - target.0).abs() < line * 6.0 => { + let t = (dt * 14.0).min(1.0); + let next = (c + (target.0 - c) * t, h + (target.1 - h) * t); + if (next.0 - target.0).abs() > 0.3 { + ui.ctx().request_repaint(); + } + next + } + // A jump (a slide chosen, the wheel turned far): the band goes straight there. + _ => target, + }; + self.prompter_band = Some(band_now); + self.prompter_rows = rows; let p = ui.painter().with_clip_rect(view.expand(8.0 * k)); - let band = Rect::from_center_size(pos2(view.center().x, view.top() + read_y), vec2(view.width() + 12.0 * k, line * 1.05)); + // At first the band stays at the reading line, as the script scrolls under it; with **Band + // follows lines** it sits on the line being read instead. + let band = if self.st.prompter_band_lines { + let band_y = view.top() + lead + (band_now.0 - offset); + Rect::from_center_size(pos2(view.center().x, band_y), vec2(view.width() + 12.0 * k, band_now.1 + line * 0.3)) + } else { + Rect::from_center_size(pos2(view.center().x, view.top() + read_y), vec2(view.width() + 12.0 * k, line * 1.05)) + }; p.rect_filled(band, 4.0 * k, Color32::from_rgba_unmultiplied(255, 208, 64, 48)); for (x, dir) in [(band.left(), 1.0), (band.right(), -1.0)] { let c = pos2(x, band.center().y); @@ -1379,6 +1443,11 @@ impl App { self.st.prompter_follow = follow; self.save_layout(); } + let mut lines = self.st.prompter_band_lines; + if row.checkbox(&mut lines, RichText::new("Band follows lines").size((14.0 * k).max(11.0))).on_hover_text("The band sits on the line being read and glides from line to line, instead of staying at the reading line").changed() { + self.st.prompter_band_lines = lines; + self.save_layout(); + } // Colours: Dark (light text on a dark background) and back, or a background and text colour // of one's own. Remembered. row.add_space(10.0 * k); @@ -1818,13 +1887,13 @@ impl App { match self.screen { Screen::Black => {} Screen::White => { - let r = fit(full, self.deck.aspect.max(0.1), false); + let r = audience_rect(full, self.deck.aspect, self.st.audience_fit); ui.painter().rect_filled(r, 0.0, Color32::WHITE); self.paint_overlays(ui, r, uv_rect(None), idx); self.slide_input(ui, r, idx, "audience-board"); } Screen::Live => { - let r = fit(full, self.deck.aspect.max(0.1), false); + let r = audience_rect(full, self.deck.aspect, self.st.audience_fit); self.paint_slide(ui, r, idx); // On a single screen the fullscreen slide is the only place to point and draw. self.slide_input(ui, r, idx, "audience-slide"); @@ -2181,6 +2250,30 @@ pub fn engine_combo(ui: &mut Ui, e: &mut Engine) { mod tests { use super::*; + #[test] + fn audience_slide_fits_fills_or_stretches() { + use crate::settings::AudienceFit; + let tv = Rect::from_min_size(Pos2::ZERO, vec2(1920.0, 1080.0)); + let fit = audience_rect(tv, 4.0 / 3.0, AudienceFit::Fit); + assert_eq!((fit.width(), fit.height()), (1440.0, 1080.0), "a 4:3 slide keeps its shape, bands at the sides"); + assert_eq!(fit.center(), tv.center()); + let fill = audience_rect(tv, 4.0 / 3.0, AudienceFit::Fill); + assert_eq!((fill.width(), fill.height()), (1920.0, 1440.0), "the screen is covered, top and bottom trimmed"); + assert_eq!(fill.center(), tv.center()); + assert_eq!(audience_rect(tv, 4.0 / 3.0, AudienceFit::Stretch), tv); + // A wide slide on a tall screen. + let tall = Rect::from_min_size(Pos2::ZERO, vec2(1080.0, 1920.0)); + let fit = audience_rect(tall, 16.0 / 9.0, AudienceFit::Fit); + assert!((fit.width() - 1080.0).abs() < 0.01 && (fit.height() - 607.5).abs() < 0.01); + let fill = audience_rect(tall, 16.0 / 9.0, AudienceFit::Fill); + assert!((fill.height() - 1920.0).abs() < 0.01 && fill.width() > 1080.0); + // A 16:9 slide on a 16:9 screen fills it whichever way. + for how in AudienceFit::ALL { + let r = audience_rect(tv, 16.0 / 9.0, how); + assert!((r.width() - 1920.0).abs() < 0.01 && (r.height() - 1080.0).abs() < 0.01, "{how:?}"); + } + } + /// The case from the report: a 4:3 notes page in a wide window left an empty strip beside it. #[test] fn notes_column_fits_its_page_and_the_slides_take_the_rest() {