From 050ddcb567602124c4fc949525cf88f348439d4e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 18:29:23 -0800 Subject: [PATCH 1/6] Fix #9051: Display Print Size shows 100% at the display's physical size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With Preferences › General › Display Print Size at 100% Zoom on, 100% took 96 screen points to an inch on every display, so a ruler held to the screen measured more or less than the document said on any display of another density. The desktop app now measures the density of the display that shows the main window from the physical size the system reports (CGDisplayScreenSize on macOS, the monitor's raw DPI on Windows, the RandR output's millimeters on X11, the wl_output geometry on Wayland), and measures it again when the window moves to another display, where every document window keeps its zoom percentage so the art keeps its physical size. Actual Size, the zoom field, the zoom stops and the tab titles count 100% from that density. Where the system reports no size, or a size no display has (zero, an aspect ratio given as the size, or axes that disagree), an inch stays 96 points, as on the web. Zoom stepping takes the density from the app instead of a process-wide flag, and the last zoom stop in each direction stays in the zoom range. --- apps/vectorcraft/Cargo.toml | 8 +- apps/vectorcraft/src/app.rs | 5 + apps/vectorcraft/src/main.rs | 7 + apps/vectorcraft/src/screen_density.rs | 252 ++++++++++++++++++ apps/vectorcraft/src/windows_display_size.rs | 19 ++ crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/app.rs | 1 - crates/ui-egui/src/app/commands.rs | 1 - crates/ui-egui/src/app/view.rs | 28 ++ crates/ui-egui/src/canvas/input.rs | 6 +- crates/ui-egui/src/canvas/tests.rs | 45 +++- crates/ui-egui/src/canvas/view.rs | 13 +- crates/ui-egui/src/chrome/status_bar.rs | 2 +- crates/ui-egui/src/chrome/tabs.rs | 10 +- crates/ui-egui/src/chrome/tests.rs | 2 +- crates/ui-egui/src/control/tests.rs | 2 +- crates/ui-egui/src/doc_windows/views.rs | 9 + crates/ui-egui/src/menus/run.rs | 6 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels/info.rs | 6 +- .../ui-egui/src/prefs_dialog/descriptions.rs | 5 +- crates/ui-egui/src/services.rs | 6 + crates/ui-egui/src/state.rs | 91 ++++--- docs/mcp.md | 5 +- docs/target-app-parity.md | 2 +- 25 files changed, 464 insertions(+), 71 deletions(-) create mode 100644 apps/vectorcraft/src/screen_density.rs create mode 100644 apps/vectorcraft/src/windows_display_size.rs diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml index 0fe5804a16..a62f75ca37 100644 --- a/apps/vectorcraft/Cargo.toml +++ b/apps/vectorcraft/Cargo.toml @@ -65,8 +65,9 @@ pollster = "1" # which src/host_services.rs uses to read the path PhotoCraft registers under App Paths. # Win32_Devices_Display has `QueryDisplayConfig`, Win32_UI_ColorSystem the display's ICC profile and # Win32_System_LibraryLoader `GetProcAddress`, which src/display_profile.rs uses to read the -# display's color profile for the canvas. -windows = { version = "0.62", features = ["Win32_Devices_Display", "Win32_Foundation", "Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_System_LibraryLoader", "Win32_System_Registry", "Win32_System_Threading", "Win32_UI_ColorSystem", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_Input_Pointer", "Win32_UI_WindowsAndMessaging"] } +# display's color profile for the canvas. Win32_UI_HiDpi has `GetDpiForMonitor`, which +# src/windows_display_size.rs uses to read a monitor's raw density for Display Print Size. +windows = { version = "0.62", features = ["Win32_Devices_Display", "Win32_Foundation", "Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_System_LibraryLoader", "Win32_System_Registry", "Win32_System_Threading", "Win32_UI_ColorSystem", "Win32_UI_HiDpi", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_Input_Pointer", "Win32_UI_WindowsAndMessaging"] } # The renderer's worker count follows those cores (src/windows_cores.rs). vectorcraft-render = { workspace = true } @@ -90,7 +91,8 @@ objc2-core-text = { version = "0.3", default-features = false, features = ["std" # The windows' Metal layers and the sRGB color space they are tagged with (src/mac_color_space.rs). # Zlib OR Apache-2.0 OR MIT, already in the build through wgpu with these features. objc2-quartz-core = { version = "0.3", default-features = false, features = ["std", "objc2-core-foundation", "objc2-core-graphics", "CALayer", "CAMetalLayer"] } -objc2-core-graphics = { version = "0.3", default-features = false, features = ["std", "CGColorSpace"] } +# CGDisplayScreenSize gives a display's physical size for Display Print Size (src/screen_density.rs). +objc2-core-graphics = { version = "0.3", default-features = false, features = ["std", "CGColorSpace", "CGDirectDisplay", "CGDisplayConfiguration"] } # Waits for the answer of a file dialog shown as a sheet (src/main.rs, #867). MIT OR Apache-2.0, # already in the build through eframe. pollster = "1" diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs index a40eb0c92f..c93a1d0341 100644 --- a/apps/vectorcraft/src/app.rs +++ b/apps/vectorcraft/src/app.rs @@ -208,6 +208,11 @@ impl App { } if let Some(w) = &self.winit_window { self.display_profile.tick(w, now, self.app.session.prefs.monitor_profile_display, &self.app.display_profile, ctx); + if let Some(read) = self.screen_density.tick(w, now) + && self.app.set_screen_ppi(read) + { + ctx.request_repaint(); + } } self.app.tick(ctx); if self.pending_maximize { diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index 29cb56bdfa..00e82a0298 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -67,6 +67,7 @@ mod presentation; mod printing; #[cfg(not(any(target_os = "macos", windows)))] mod quit_windows; +mod screen_density; #[cfg(not(target_os = "macos"))] mod single_instance; #[cfg(windows)] @@ -77,6 +78,8 @@ mod window_frame; mod windows_alt_codes; #[cfg(windows)] mod windows_cores; +#[cfg(windows)] +mod windows_display_size; mod windows_screen_color; mod windows_stylus; mod xwayland; @@ -140,6 +143,9 @@ struct App { monitors_listed: Option<(f64, f32)>, /// Reads the profile of the display that shows the main window, for the canvas. display_profile: display_profile::Reader, + /// Measures the density of the display that shows the main window, for Display Print Size at + /// 100% Zoom. + screen_density: screen_density::Tracker, /// When this frame's input hook started, for the hang report's frame times (`hang_watch`). frame_start: Option, /// The shortest time between the starts of two frames, while the window presents without vsync @@ -712,6 +718,7 @@ fn main() -> std::process::ExitCode { held_files, monitors_listed: None, display_profile: Default::default(), + screen_density: Default::default(), frame_start: None, min_frame, last_frame_began: None, diff --git a/apps/vectorcraft/src/screen_density.rs b/apps/vectorcraft/src/screen_density.rs new file mode 100644 index 0000000000..3a91f7f4d4 --- /dev/null +++ b/apps/vectorcraft/src/screen_density.rs @@ -0,0 +1,252 @@ +//! The density of the display that shows most of the main window, in the window's points per +//! inch, for Preferences › General › Display Print Size at 100% Zoom (`Services::screen_ppi`): +//! the display's size in points divided by the physical size the system reports for it. +//! +//! - macOS: `CGDisplayScreenSize`. +//! - Windows: `GetDpiForMonitor`'s raw density (`windows_display_size`). +//! - X11, XWayland included: the RandR output's width and height in millimeters. +//! - Wayland: the physical width and height of the compositor's `wl_output` for the display. +//! +//! A display that reports no size, or a size no display has, gives `None`, and an inch then takes +//! 96 points. The window's display is looked up once a second while the app draws, and read when +//! it changes. + +use winit::dpi::{PhysicalPosition, PhysicalSize}; +use winit::monitor::MonitorHandle; + +/// Seconds between two checks of which display shows the window. +const LOOK_EVERY: f64 = 1.0; + +/// Millimeters in an inch. +const MM_PER_INCH: f64 = 25.4; + +/// How far the horizontal and vertical densities of one display may differ, as a fraction of the +/// larger: square pixels on a display that reports its true size give two densities this close. +const AXES_AGREE: f64 = 0.1; + +/// What identifies the display and the window's scale on it between two looks. +type Shown = (Option, PhysicalPosition, PhysicalSize, u64); + +/// Keeps the density current from the main window's frames. +#[derive(Default)] +pub(crate) struct Tracker { + /// When the window's display was last looked up. + looked: Option, + /// The display read last, with the window's scale factor then. + shown: Option, +} + +impl Tracker { + /// Looks up the window's display when a look is due at `now` (seconds), and returns its + /// density (`None` inside for a display that reports no size) when the display or the + /// window's scale changed since the last reading. + pub(crate) fn tick(&mut self, window: &winit::window::Window, now: f64) -> Option> { + if self.looked.is_some_and(|at| (at..at + LOOK_EVERY).contains(&now)) { + return None; + } + self.looked = Some(now); + let monitor = window.current_monitor(); + let scale = window.scale_factor(); + let shown = monitor.as_ref().map(|m| (m.name(), m.position(), m.size(), scale.to_bits())); + if shown == self.shown { + return None; + } + self.shown = shown; + let read = monitor.and_then(|m| points_per_inch(m.size(), scale, physical_mm(window, &m)?)); + match read { + Some(p) => log::info!("the window's display has {p:.1} points to an inch"), + None => log::info!("the window's display reports no physical size; an inch is 96 points"), + } + Some(read) + } +} + +/// The density, in points per inch, of a display `size` physical pixels wide and high, with the +/// window drawn at `scale` pixels to a point, that the system says is `mm` millimeters wide and +/// high. `None` for a size that is no display's: zero or less, an aspect ratio given in place of +/// the size (16 × 9, 160 × 90 and the like), axes whose densities disagree in either orientation, +/// or a density outside [`vectorcraft_ui_egui::state::SCREEN_PPI_RANGE`]. A display turned a +/// quarter turn may report the size of its panel upright, so the axes are also tried swapped. +pub(crate) fn points_per_inch(size: PhysicalSize, scale: f64, mm: [f64; 2]) -> Option { + if !(scale.is_finite() && scale > 0.0) || mm.iter().any(|v| !(v.is_finite() && *v > 0.0)) || aspect_as_size(mm) { + return None; + } + let points = [f64::from(size.width) / scale, f64::from(size.height) / scale]; + let density = |[w, h]: [f64; 2]| [points[0] / (w / MM_PER_INCH), points[1] / (h / MM_PER_INCH)]; + let agree = |[x, y]: [f64; 2]| (x - y).abs() <= AXES_AGREE * x.max(y); + let [x, y] = [density(mm), density([mm[1], mm[0]])].into_iter().find(|d| agree(*d))?; + let ppi = (x + y) / 2.0; + vectorcraft_ui_egui::state::SCREEN_PPI_RANGE.contains(&ppi).then_some(ppi) +} + +/// Whether `mm` is an aspect ratio that a display's EDID gave in place of its size: 16:9, 16:10 +/// or 4:3, in centimeters or tenths of them. +fn aspect_as_size(mm: [f64; 2]) -> bool { + const RATIOS: [[f64; 2]; 3] = [[16.0, 9.0], [16.0, 10.0], [4.0, 3.0]]; + let sorted = if mm[0] >= mm[1] { mm } else { [mm[1], mm[0]] }; + RATIOS.iter().any(|r| [1.0, 10.0].iter().any(|k| sorted == [r[0] * k, r[1] * k])) +} + +/// The physical width and height, in millimeters, the system reports for `monitor`. +#[cfg(target_os = "macos")] +fn physical_mm(_: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { + use winit::platform::macos::MonitorHandleExtMacOS as _; + let size = objc2_core_graphics::CGDisplayScreenSize(monitor.native_id()); + Some([size.width, size.height]) +} + +#[cfg(windows)] +fn physical_mm(_: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { + use winit::platform::windows::MonitorHandleExtWindows as _; + let [x, y] = crate::windows_display_size::raw_dpi(monitor.hmonitor())?; + let size = monitor.size(); + Some([f64::from(size.width) / x * MM_PER_INCH, f64::from(size.height) / y * MM_PER_INCH]) +} + +#[cfg(target_os = "linux")] +fn physical_mm(window: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { + use winit::raw_window_handle::{HasWindowHandle as _, RawWindowHandle}; + let wayland = window.window_handle().ok().is_some_and(|h| matches!(h.as_raw(), RawWindowHandle::Wayland(_))); + let read = if wayland { wayland::physical_mm(monitor.name().as_deref()) } else { x11::physical_mm(monitor) }; + read.unwrap_or_else(|e| { + log::debug!("couldn't read the display's physical size: {e}"); + None + }) +} + +#[cfg(not(any(target_os = "macos", windows, target_os = "linux")))] +fn physical_mm(_: &winit::window::Window, _: &MonitorHandle) -> Option<[f64; 2]> { + None +} + +#[cfg(target_os = "linux")] +mod x11 { + use winit::monitor::MonitorHandle; + use winit::platform::x11::MonitorHandleExtX11 as _; + use x11rb::CURRENT_TIME; + use x11rb::protocol::randr; + + /// The millimeters RandR reports for the first output of the CRTC that shows `monitor`. + pub(super) fn physical_mm(monitor: &MonitorHandle) -> Result, String> { + let (conn, _) = x11rb::connect(None).map_err(|e| format!("couldn't connect to the X11 display: {e}"))?; + let ask = |e: x11rb::errors::ConnectionError| format!("couldn't ask the X11 display: {e}"); + let crtc = randr::get_crtc_info(&conn, monitor.native_id(), CURRENT_TIME) + .map_err(ask)? + .reply() + .map_err(|e| format!("the X11 display has no such CRTC: {e}"))?; + let Some(output) = crtc.outputs.first() else { return Ok(None) }; + let info = randr::get_output_info(&conn, *output, CURRENT_TIME) + .map_err(ask)? + .reply() + .map_err(|e| format!("the X11 display has no such output: {e}"))?; + Ok(Some([f64::from(info.mm_width), f64::from(info.mm_height)])) + } +} + +#[cfg(target_os = "linux")] +mod wayland { + use wayland_client::globals::{GlobalListContents, registry_queue_init}; + use wayland_client::protocol::wl_output::{self, WlOutput}; + use wayland_client::protocol::wl_registry::{self, WlRegistry}; + use wayland_client::{Connection, Dispatch, QueueHandle}; + + /// The physical size the compositor gives for the output named `name`, asked on a connection + /// of its own; with no name, or a compositor that names no outputs, the only output's. + pub(super) fn physical_mm(name: Option<&str>) -> Result, String> { + let conn = Connection::connect_to_env().map_err(|e| format!("no Wayland compositor: {e}"))?; + let (globals, mut queue) = registry_queue_init::(&conn).map_err(|e| e.to_string())?; + let qh = queue.handle(); + let mut state = Outputs::default(); + for global in globals.contents().clone_list().into_iter().filter(|g| g.interface == "wl_output") { + // Version 4 names the output; older ones give its size only. + let output: WlOutput = globals.registry().bind(global.name, global.version.min(4), &qh, state.outputs.len()); + state.outputs.push((output, Output::default())); + } + // The compositor sends each output's geometry, name and `done` in reply to the bind. + queue.roundtrip(&mut state).map_err(|e| e.to_string())?; + let found: Vec<&Output> = state.outputs.iter().map(|(_, o)| o).collect(); + let pick = match name { + Some(name) if found.iter().any(|o| o.name.is_some()) => found.iter().find(|o| o.name.as_deref() == Some(name)), + _ if found.len() == 1 => found.first(), + _ => None, + }; + Ok(pick.and_then(|o| o.mm)) + } + + /// One output's name and physical size. + #[derive(Default)] + struct Output { + name: Option, + mm: Option<[f64; 2]>, + } + + /// The outputs bound, each with what its events gave. + #[derive(Default)] + struct Outputs { + outputs: Vec<(WlOutput, Output)>, + } + + impl Dispatch for Outputs { + fn event(_: &mut Self, _: &WlRegistry, _: wl_registry::Event, _: &GlobalListContents, _: &Connection, _: &QueueHandle) {} + } + + impl Dispatch for Outputs { + fn event(state: &mut Self, _: &WlOutput, event: wl_output::Event, index: &usize, _: &Connection, _: &QueueHandle) { + let Some((_, output)) = state.outputs.get_mut(*index) else { return }; + match event { + wl_output::Event::Geometry { physical_width, physical_height, .. } => { + output.mm = Some([f64::from(physical_width), f64::from(physical_height)]); + } + wl_output::Event::Name { name } => output.name = Some(name), + _ => {} + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A 14-inch laptop panel at twice its points: 3024 × 1964 pixels, 302 × 196 mm, draws 127 + /// points to an inch, more than the 96 a fixed inch assumes. + #[test] + fn a_laptop_panel_has_more_points_to_an_inch_than_the_reference() { + let ppi = points_per_inch(PhysicalSize::new(3024, 1964), 2.0, [302.0, 196.0]); + assert!(ppi.is_some_and(|p| p > 96.0 && (p - 1512.0 / (302.0 / MM_PER_INCH)).abs() < 1.0), "{ppi:?}"); + } + + /// The same display in a scaled mode (more points on the same glass) draws more points to an + /// inch, and at a higher scale factor fewer: the density counts the window's points. + #[test] + fn the_density_counts_points_at_the_windows_scale() { + let at = |w, h, scale| points_per_inch(PhysicalSize::new(w, h), scale, [527.0, 296.0]).unwrap_or(0.0); + assert!(at(1920, 1080, 1.0) > 0.0); + assert!(at(2560, 1440, 1.0) > at(1920, 1080, 1.0), "more pixels on the same glass"); + assert!(at(3840, 2160, 2.0) < at(3840, 2160, 1.5), "a larger scale factor makes each point larger"); + } + + /// A display turned a quarter turn whose system reports its panel's size upright still + /// measures; axes that disagree either way do not. + #[test] + fn a_turned_display_measures_and_disagreeing_axes_do_not() { + let upright = points_per_inch(PhysicalSize::new(1920, 1080), 1.0, [527.0, 296.0]); + let turned = points_per_inch(PhysicalSize::new(1080, 1920), 1.0, [527.0, 296.0]); + assert!(upright.is_some() && turned.is_some()); + assert!((upright.unwrap_or(0.0) - turned.unwrap_or(1.0)).abs() < 1e-9); + assert_eq!(points_per_inch(PhysicalSize::new(1920, 1080), 1.0, [527.0, 527.0]), None); + } + + /// Sizes no display has give no density: none, an aspect ratio in place of the size, and + /// densities past the range a display can have. + #[test] + fn reports_that_are_no_displays_size_give_no_density() { + let at = |mm| points_per_inch(PhysicalSize::new(1920, 1080), 1.0, mm); + for mm in [[0.0, 0.0], [-1.0, 300.0], [f64::NAN, 300.0], [160.0, 90.0], [16.0, 9.0], [160.0, 100.0], [40.0, 30.0], [9.0, 16.0]] { + assert_eq!(at(mm), None, "{mm:?}"); + } + assert_eq!(points_per_inch(PhysicalSize::new(1920, 1080), 0.0, [527.0, 296.0]), None, "no scale"); + assert_eq!(points_per_inch(PhysicalSize::new(100, 56), 1.0, [5270.0, 2960.0]), None, "under the range"); + assert_eq!(points_per_inch(PhysicalSize::new(7680, 4320), 1.0, [53.0, 30.0]), None, "over it"); + } +} diff --git a/apps/vectorcraft/src/windows_display_size.rs b/apps/vectorcraft/src/windows_display_size.rs new file mode 100644 index 0000000000..a46c7989b2 --- /dev/null +++ b/apps/vectorcraft/src/windows_display_size.rs @@ -0,0 +1,19 @@ +//! Windows: a monitor's raw density, the pixels per inch of the screen itself as Windows reads it +//! from the monitor, for Display Print Size at 100% Zoom (`crate::screen_density`). +//! +//! `GetDpiForMonitor` is a C API with no safe binding, hence the scoped `unsafe_code` allowance. +#![allow(unsafe_code)] + +use windows::Win32::Graphics::Gdi::HMONITOR; +use windows::Win32::UI::HiDpi::{GetDpiForMonitor, MDT_RAW_DPI}; + +/// The horizontal and vertical pixels per inch of the monitor winit's handle `monitor` names, or +/// `None` when Windows reports none for it. +pub(crate) fn raw_dpi(monitor: isize) -> Option<[f64; 2]> { + let (mut x, mut y) = (0u32, 0u32); + // SAFETY: `monitor` is a handle winit got from Windows for a connected monitor; a handle that + // has gone stale makes the call fail, which returns `None`. Both pointers point at live `u32`s + // for the length of the call. + unsafe { GetDpiForMonitor(HMONITOR(monitor as *mut core::ffi::c_void), MDT_RAW_DPI, &mut x, &mut y) }.ok()?; + (x > 0 && y > 0).then(|| [f64::from(x), f64::from(y)]) +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index c3dbf78293..55b0df872e 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -484,7 +484,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "view.actualSize", "Actual Size", "Cmd+1", - "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills 96 screen points (an inch at the system's reference density, whatever the display scaling); the same at every UI Scaling", + "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none; the same at every UI Scaling", ), ("view.setZoom", "Set Zoom", "", "{zoom: percent, center?: [x,y]}"), ( diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index bba6a5d83d..47358b5842 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -586,7 +586,6 @@ impl VectorcraftApp { ctx.request_repaint(); return; } - crate::state::sync_zoom_stops_display_print_size(self.session.prefs.display_print_size); // Whether this pass draws the last step of an action playing at Step by Step. let step_held = crate::panels::actions::playback_held(self); let t0 = now_ms(); diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index 042e8b37a5..0bad136114 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -136,7 +136,6 @@ impl VectorcraftApp { /// [`Self::run`] it, inside what asks for file dialogs. fn run_now(&mut self, id: &str, params: Value) -> Result { - crate::state::sync_zoom_stops_display_print_size(self.session.prefs.display_print_size); self.run_count = self.run_count.wrapping_add(1); // In debug builds the app's own calls are held to the params descriptions too (#1442): a // panel passing a key its command doesn't read shows up in the tests. Saved steps aren't diff --git a/crates/ui-egui/src/app/view.rs b/crates/ui-egui/src/app/view.rs index 1e9d931a0a..ae107769e6 100644 --- a/crates/ui-egui/src/app/view.rs +++ b/crates/ui-egui/src/app/view.rs @@ -104,6 +104,34 @@ impl VectorcraftApp { self.session.active().map_or(vectorcraft_geom::Point::ZERO, |d| d.doc.ruler_origin_for(artboard)) } + /// The screen points an inch takes at 100% zoom with Display Print Size at 100% Zoom on, for + /// the display that shows the window; `None` with it off ([`crate::state::print_ppi`]). + pub(crate) fn print_ppi(&self) -> Option { + crate::state::print_ppi(self.session.prefs.display_print_size, self.services.screen_ppi) + } + + /// Takes `ppi` as the measured density of the main window's display + /// ([`crate::Services::screen_ppi`]). With Display Print Size at 100% Zoom on, every document + /// window's view keeps its zoom percentage, so the art keeps its physical size on the new + /// display. Returns whether the density changed. + pub fn set_screen_ppi(&mut self, ppi: Option) -> bool { + if self.services.screen_ppi == ppi { + return false; + } + let before = self.print_ppi(); + self.services.screen_ppi = ppi; + if let (Some(before), Some(after)) = (before, self.print_ppi()) + && before != after + { + let k = after / before; + for v in &mut self.views { + v.zoom = (v.zoom * k).clamp(0.0313, 640.0); + } + self.canvas.windows.views.scale_zooms(k); + } + true + } + pub fn view_mut(&mut self) -> Option<&mut View> { self.sync_views(); let i = self.session.active_index()?; diff --git a/crates/ui-egui/src/canvas/input.rs b/crates/ui-egui/src/canvas/input.rs index a6a0509de5..9e1d9cf151 100644 --- a/crates/ui-egui/src/canvas/input.rs +++ b/crates/ui-egui/src/canvas/input.rs @@ -602,7 +602,7 @@ fn drag_released(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, d: Drag, p: Po }); // Backtick as it was at the button-up: a key pressed or released later in the frame does not count. let backquote = backquote_at_release(ui, egui::PointerButton::Primary, f.backquote_before); - let ui_zoom = app.canvas_ui_zoom; + let (ui_zoom, print) = (app.canvas_ui_zoom, app.print_ppi()); match d { Drag::ZoomBox { start } => { let start = zoom_marquee_start(ui, start, before, p); @@ -615,14 +615,14 @@ fn drag_released(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, d: Drag, p: Po let fill = (rect.width() / r.width()).min(rect.height() / r.height()); vm.zoom = (xf.zoom * f64::from(ui_zoom) * f64::from(fill)).clamp(0.0313, 640.0); } else { - zoom_about(vm, rect, p, crate::state::next_zoom(vm.zoom, !m.alt), ui_zoom); + zoom_about(vm, rect, p, crate::state::next_zoom(vm.zoom, !m.alt, print), ui_zoom); } } } // A click (not held, not dragged) steps the zoom as with the marquee. Drag::ZoomScrub { held, moved: false, .. } if held <= HOLD_DELAY => { if let Some(vm) = app.view_mut() { - zoom_about(vm, rect, p, crate::state::next_zoom(vm.zoom, !m.alt), ui_zoom); + zoom_about(vm, rect, p, crate::state::next_zoom(vm.zoom, !m.alt, print), ui_zoom); } } Drag::ZoomScrub { .. } => {} diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d5244aa234..3cbe57eefd 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -8550,6 +8550,41 @@ fn view_actual_size_follows_display_print_size() { assert!((app.view().unwrap().zoom - 96.0 / 72.0).abs() < 1e-12, "an inch is 96 screen points"); } +/// #9051: with Display Print Size on, Actual Size shows a document inch in an inch of the display +/// the window is on, from the density the host measured for it. When the window moves to a +/// display of another density, every document window keeps its zoom percentage, so the art keeps +/// its physical size there. +#[test] +fn view_actual_size_fills_an_inch_of_the_measured_display() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + let rect = egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0)); + app.canvas_rect = Some(rect); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + assert!(app.set_screen_ppi(Some(127.0))); + let inch = |v: &View| { + let xf = Xf::new(rect, v); + f64::from(xf.to_screen(Point::new(72.0, 0.0)).x - xf.to_screen(Point::new(0.0, 0.0)).x) + }; + app.run("view.actualSize", json!({})).unwrap(); + assert!((inch(app.view().unwrap()) - 127.0).abs() < 1e-3, "72 pt take the display's 127 points to an inch"); + app.run("window.newWindow", json!({})).unwrap(); + let stepped = app.run("view.zoomIn", json!({})).unwrap()["zoom"].as_f64().unwrap_or(0.0); + assert!((stepped - 150.0).abs() < 1e-9, "the stops count from that 100%: {stepped}"); + assert!(app.set_screen_ppi(Some(91.0)), "the window moved to a sparser display"); + assert!(!app.set_screen_ppi(Some(91.0)), "the same reading changes nothing"); + let first = *crate::doc_windows::view(&app, (0, 1)).unwrap(); + assert!((inch(&first) - 91.0).abs() < 1e-3, "the other window's 100% still fills an inch"); + assert_eq!(crate::state::zoom_label(first.zoom, app.print_ppi()), "100%"); + assert_eq!(crate::state::zoom_label(app.view().unwrap().zoom, app.print_ppi()), "150%"); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); + let zoom = app.view().unwrap().zoom; + assert!(app.set_screen_ppi(Some(127.0))); + assert_eq!(app.view().unwrap().zoom, zoom, "off, a move leaves the zoom alone"); + app.run("view.actualSize", json!({})).unwrap(); + assert!((app.view().unwrap().zoom - 1.0).abs() < 1e-12, "and 100% stays one point per point"); +} + /// Fit Artboard in Window fits the artboard as a rotated view shows it: at 45° every corner is /// on the canvas and one is within the 30-point margin of an edge. At 0° the zoom is unchanged. #[test] @@ -8604,7 +8639,7 @@ fn animated_zoom_scrubs_and_holds_else_the_zoom_tool_zooms_to_an_area() { press(&mut app, vec2(-100.0, 0.0), 0); assert!((app.view().unwrap().zoom - z0).abs() < 1e-6, "and back to the left"); press(&mut app, vec2(0.0, 0.0), 0); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z0, true), "a click steps"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z0, true, None), "a click steps"); let z2 = app.view().unwrap().zoom; press(&mut app, vec2(0.0, 0.0), 40); assert!(app.view().unwrap().zoom > z2 * 1.2, "held, it zooms on"); @@ -8959,9 +8994,9 @@ fn cmd_space_zooms_and_space_pans_whatever_the_tool() { let z0 = app.view().unwrap().zoom; drag(&mut app, Modifiers::COMMAND, at); let z1 = app.view().unwrap().zoom; - assert_eq!(z1, crate::state::next_zoom(z0, true), "Cmd+Space click zooms in"); + assert_eq!(z1, crate::state::next_zoom(z0, true, None), "Cmd+Space click zooms in"); drag(&mut app, Modifiers::COMMAND | Modifiers::ALT, at); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z1, false), "Cmd+Alt+Space click zooms out"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z1, false, None), "Cmd+Alt+Space click zooms out"); assert_eq!(app.session.active().unwrap().doc.art_bounds(), None, "the Rectangle tool drew nothing"); // Space alone pans, with the Zoom tool too. app.select_tool("zoom"); @@ -9009,7 +9044,7 @@ fn space_types_a_space_while_editing_text_and_does_not_pan() { assert_eq!(shown(&mut app), CursorIcon::ZoomIn, "Cmd+Space shows the magnifier"); typing_frame(&mut app, &ctx, vec![button(at, true, Modifiers::COMMAND)]); typing_frame(&mut app, &ctx, vec![button(at, false, Modifiers::COMMAND)]); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(before.zoom, true), "Cmd+Space click zooms in"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(before.zoom, true, None), "Cmd+Space click zooms in"); typing_frame(&mut app, &ctx, vec![space(false, Modifiers::COMMAND), Event::ModifiersChanged(Modifiers::NONE)]); assert_eq!(plain(&app, id), "a ", "the text is as typed"); } @@ -9119,7 +9154,7 @@ fn space_shift_drag_rotates_the_view_whatever_the_tool() { assert_eq!((panned.rotation, panned.zoom), (v.rotation, v.zoom)); assert_ne!(panned.center, v.center, "Space pans"); drag(&mut app, Modifiers::COMMAND | Modifiers::SHIFT, true, c, c); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(v.zoom, true), "Cmd+Shift+Space click zooms in"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(v.zoom, true, None), "Cmd+Shift+Space click zooms in"); assert_eq!(app.view().unwrap().rotation, v.rotation); // The Rotate View tool's Shift still rounds to 15°. app.select_tool("rotateView"); diff --git a/crates/ui-egui/src/canvas/view.rs b/crates/ui-egui/src/canvas/view.rs index b2669b128d..825db3940d 100644 --- a/crates/ui-egui/src/canvas/view.rs +++ b/crates/ui-egui/src/canvas/view.rs @@ -31,7 +31,7 @@ pub fn fit(app: &mut VectorcraftApp, how: &str) { }; let Some(target) = target else { return }; let zoom = if how == "view.actualSize" { - actual_size_zoom(app.session.prefs.display_print_size) + actual_size_zoom(app.print_ppi()) } else { fit_zoom(rect, target, app.view().map_or(0.0, |v| v.rotation), app.canvas_ui_zoom) }; @@ -102,11 +102,12 @@ pub(crate) fn animated_zoom(p: &vectorcraft_engine::Prefs) -> bool { } /// Zoom for View → Actual Size (`view.actualSize`). With Preferences › General › Display Print -/// Size at 100% Zoom off, one document point is one screen point. On, one document inch (72 pt) -/// fills an inch of the screen as the system counts it: 96 screen points, the reference density -/// that display scaling is set against (a CSS inch), whatever the scale factor. -pub(crate) fn actual_size_zoom(display_print_size: bool) -> f64 { - if display_print_size { 96.0 / 72.0 } else { 1.0 } +/// Size at 100% Zoom off (`print` `None`), one document point is one screen point. On, one +/// document inch (72 pt) fills an inch of the display that shows the window: `print` screen +/// points, its measured density, or 96 (a CSS inch) where the system reports no physical size +/// ([`crate::state::print_ppi`]). +pub(crate) fn actual_size_zoom(print: Option) -> f64 { + crate::state::zoom_baseline(print) } /// Zoom view `vm` of the canvas `rect` to `zoom` (clamped to the zoom range), keeping the document diff --git a/crates/ui-egui/src/chrome/status_bar.rs b/crates/ui-egui/src/chrome/status_bar.rs index 126cc956f3..8149c3cb5a 100644 --- a/crates/ui-egui/src/chrome/status_bar.rs +++ b/crates/ui-egui/src/chrome/status_bar.rs @@ -10,7 +10,7 @@ pub fn status_bar(app: &mut VectorcraftApp, ui: &mut Ui) { .show(ui, |ui| { ui.horizontal_centered(|ui| { let zoom = app.view().map(|v| v.zoom).unwrap_or(1.0); - let print = app.session.prefs.display_print_size; + let print = app.print_ppi(); let shown = crate::state::zoom_display_percent(zoom, print); ui.name_inputs(tl!("Zoom"), |ui| { craft_ui::ComboBox::from_id_salt("zoom-combo") diff --git a/crates/ui-egui/src/chrome/tabs.rs b/crates/ui-egui/src/chrome/tabs.rs index b92d1e5d04..e27877ca11 100644 --- a/crates/ui-egui/src/chrome/tabs.rs +++ b/crates/ui-egui/src/chrome/tabs.rs @@ -2,21 +2,21 @@ use super::{Sense, Stroke, Tokens, Ui, VectorcraftApp, icons, json, theme, vec2, /// [`view_tab_title`] for a document with one view. #[cfg(test)] -pub(super) fn tab_title(d: &vectorcraft_engine::DocState, zoom: f64, outline: bool, display_print_size: bool) -> String { - view_tab_title(d, None, zoom, outline, display_print_size) +pub(super) fn tab_title(d: &vectorcraft_engine::DocState, zoom: f64, outline: bool, print: Option) -> String { + view_tab_title(d, None, zoom, outline, print) } /// A document tab's title: "Name* @ 66.67 % (RGB/Preview)", or while an opacity mask is edited /// "Name* @ 66.67 % (/Opacity Mask)". For a view of a document with more than one /// view, the view's `number` follows the name: "Name:2* @ 66.67 % (RGB/Preview)". -fn view_tab_title(d: &vectorcraft_engine::DocState, number: Option, zoom: f64, outline: bool, display_print_size: bool) -> String { +fn view_tab_title(d: &vectorcraft_engine::DocState, number: Option, zoom: f64, outline: bool, print: Option) -> String { let mode = if d.doc.mask_edit.is_some() { format!("<{0}>/{0}", tl!("Opacity Mask")) } else { let color = if d.doc.color_mode == vectorcraft_doc::ColorMode::Cmyk { "CMYK" } else { "RGB" }; format!("{color}/{}", if outline { tl!("Outline") } else { tl!("Preview") }) }; - format!("{} @ {} ({mode})", view_tab_name(d, number), zoom_label(zoom, display_print_size).replace('%', " %")) + format!("{} @ {} ({mode})", view_tab_name(d, number), zoom_label(zoom, print).replace('%', " %")) } /// The start of [`view_tab_title`], which an inactive document tab shows alone (#8582): "Name*", @@ -31,7 +31,7 @@ fn view_tab_name(d: &vectorcraft_engine::DocState, number: Option) -> Strin fn window_tab_title(app: &VectorcraftApp, w: crate::doc_windows::Win, d: &vectorcraft_engine::DocState) -> String { let view = crate::doc_windows::view(app, w); let zoom = view.map_or(1.0, |v| v.zoom); - view_tab_title(d, crate::doc_windows::label(app, w), zoom, view.is_some_and(|v| v.outline), app.session.prefs.display_print_size) + view_tab_title(d, crate::doc_windows::label(app, w), zoom, view.is_some_and(|v| v.outline), app.print_ppi()) } /// The title of window `w`'s tab and floating window ([`crate::doc_windows`]). diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 3b889b1f09..d5a5743744 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -1918,7 +1918,7 @@ fn the_tab_title_names_the_opacity_mask_while_it_is_edited() { let mut s = Session::new(); s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap(); - let title = |s: &Session| super::tab_title(s.active().unwrap(), 1.0, false, false); + let title = |s: &Session| super::tab_title(s.active().unwrap(), 1.0, false, None); assert!(title(&s).ends_with("(RGB/Preview)"), "{}", title(&s)); s.execute("transparency.makeOpacityMask", &json!({})).unwrap(); assert!(title(&s).ends_with("(/Opacity Mask)"), "{}", title(&s)); diff --git a/crates/ui-egui/src/control/tests.rs b/crates/ui-egui/src/control/tests.rs index 96c4880d39..96ffd47261 100644 --- a/crates/ui-egui/src/control/tests.rs +++ b/crates/ui-egui/src/control/tests.rs @@ -974,7 +974,7 @@ fn ui_commands_refuse_params_of_the_wrong_type() { assert_eq!(after, before, "{id} {params}: nothing changes"); } app.run("view.setZoom", json!({"zoom": null, "center": null})).unwrap(); - assert_eq!(app.view().map(|v| v.zoom), Some(crate::state::zoom_from_display_percent(100.0, app.session.prefs.display_print_size))); + assert_eq!(app.view().map(|v| v.zoom), Some(crate::state::zoom_from_display_percent(100.0, app.print_ppi()))); } #[test] diff --git a/crates/ui-egui/src/doc_windows/views.rs b/crates/ui-egui/src/doc_windows/views.rs index dda76952ee..885e91fbee 100644 --- a/crates/ui-egui/src/doc_windows/views.rs +++ b/crates/ui-egui/src/doc_windows/views.rs @@ -36,6 +36,15 @@ pub struct Views { shown: HashMap, } +impl Views { + /// Multiplies the zoom of every view kept here by `k`, within the zoom range. + pub(crate) fn scale_zooms(&mut self, k: f64) { + for o in &mut self.others { + o.view.zoom = (o.view.zoom * k).clamp(0.0313, 640.0); + } + } +} + fn uid(app: &VectorcraftApp, i: usize) -> Option { app.session.documents().get(i).map(|d| d.uid) } diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index aa9451d3f9..7eda9e95ca 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -455,12 +455,12 @@ fn run_ui_part5(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option flag(&mut app.ui.view.snap_to_point), "view.zoomIn" | "view.zoomOut" => { let up = id == "view.zoomIn"; - let print = app.session.prefs.display_print_size; + let print = app.print_ppi(); // Selection & Anchor Display › Zoom to Selection: the selection comes to the middle. let focus = if app.session.prefs.zoom_to_selection { app.selection_box().map(|b| b.center()) } else { None }; match app.view_mut() { Some(v) => { - v.zoom = next_zoom(v.zoom, up); + v.zoom = next_zoom(v.zoom, up, print); if let Some(c) = focus { v.center = c; } @@ -470,7 +470,7 @@ fn run_ui_part5(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { - let print = app.session.prefs.display_print_size; + let print = app.print_ppi(); let (zoom, center) = match opt_number(p, "zoom").and_then(|z| Ok((z, opt_point(p, "center")?))) { Ok(given) => given, Err(e) => return Some(Err(e)), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d2c72aae40..920331ea39 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -485,7 +485,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "view.actualSize", "Actual Size", "Cmd+1", - "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills 96 screen points (an inch at the system's reference density, whatever the display scaling); the same at every UI Scaling", + "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none; the same at every UI Scaling", ), ("view.setZoom", "Set Zoom", "", "{zoom: percent, center?: [x,y]}"), ( diff --git a/crates/ui-egui/src/panels/info.rs b/crates/ui-egui/src/panels/info.rs index 753a4cc20b..367ed4ee80 100644 --- a/crates/ui-egui/src/panels/info.rs +++ b/crates/ui-egui/src/panels/info.rs @@ -179,7 +179,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { }); if app.session.tool_id() == "zoom" { let zoom = app.view().map_or(1.0, |v| v.zoom); - mono(ui, format!("{} {}", crate::i18n::colon(tl!("Zoom")), crate::state::zoom_label(zoom, app.session.prefs.display_print_size))); + mono(ui, format!("{} {}", crate::i18n::colon(tl!("Zoom")), crate::state::zoom_label(zoom, app.print_ppi()))); } if let Some(Readout::Brush { name: Some(name) }) = readout { mono(ui, name); @@ -315,7 +315,7 @@ mod tests { assert!(!texts(&mut app).iter().any(|t| t.starts_with("Zoom:"))); app.session.select_tool("zoom", view()).unwrap(); let zoom = app.view().map_or(1.0, |v| v.zoom); - let want = format!("Zoom: {}", crate::state::zoom_label(zoom, app.session.prefs.display_print_size)); + let want = format!("Zoom: {}", crate::state::zoom_label(zoom, app.print_ppi())); assert!(texts(&mut app).contains(&want), "{want}: {:?}", texts(&mut app)); } @@ -331,7 +331,7 @@ mod tests { crate::i18n::set_current(crate::i18n::Lang::EN); assert_eq!(shear.right[1], format!("{}\u{a0}: -12.5°", crate::i18n::tr(fr, "Shear"))); let zoom = app.view().map_or(1.0, |v| v.zoom); - let want = format!("{}\u{a0}: {}", crate::i18n::tr(fr, "Zoom"), crate::state::zoom_label(zoom, app.session.prefs.display_print_size)); + let want = format!("{}\u{a0}: {}", crate::i18n::tr(fr, "Zoom"), crate::state::zoom_label(zoom, app.print_ppi())); assert!(shown_texts.contains(&want), "{want}: {shown_texts:?}"); } diff --git a/crates/ui-egui/src/prefs_dialog/descriptions.rs b/crates/ui-egui/src/prefs_dialog/descriptions.rs index ec8aea7063..0593304e0b 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -28,7 +28,10 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ "usePreviewBounds", "Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured.", ), - ("displayPrintSize", "At 100% zoom, one inch of the document takes 96 screen points instead of 72."), + ( + "displayPrintSize", + "At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size.", + ), ("doubleClickToIsolate", "Double-clicking a group, path or image with the Selection tool opens it in isolation mode."), ( "transformPatternTiles", diff --git a/crates/ui-egui/src/services.rs b/crates/ui-egui/src/services.rs index 6c38464bd0..0fdf34b526 100644 --- a/crates/ui-egui/src/services.rs +++ b/crates/ui-egui/src/services.rs @@ -220,6 +220,12 @@ pub struct Services { /// reports for a window on that monitor. Empty on the web, and where the host cannot place a /// window by these points, which sends floating panels to the main window's monitor. pub dock_monitors: Vec, + /// The density of the display that shows most of the main window, in the window's points + /// (before UI Scaling) per inch, from the physical size the system reports for that display. + /// The desktop host keeps it current as the window moves between displays. With Display Print + /// Size at 100% Zoom, 100% shows one document inch in this many points ([`crate::state::print_ppi`]). + /// `None` on the web and where the system reports no size, and then an inch takes 96 points. + pub screen_ppi: Option, /// The text Help › Copy Troubleshooting Info copies (desktop: the platform, the graphics /// processor, recent commands and frame times, and the hang reports of this session and the /// one before). Without it the command copies the version only ([`crate::troubleshooting`]). diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index f8bce4e088..fe30649b14 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -107,15 +107,21 @@ pub const ROTATE_VIEW_ANGLES: [(&str, f64); 12] = [ ]; use super::ControlResponse; -use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::Sender; -/// Zoom stop stepping reads this (set each UI frame and before commands) so canvas wheel zoom -/// matches the status bar when Display Print Size at 100% Zoom is on. -static ZOOM_STOPS_PRINT_SIZE: AtomicBool = AtomicBool::new(false); +/// Screen points in an inch when the system reports no physical size for the display: the +/// reference density that display scaling is set against (a CSS inch). +pub const REFERENCE_PPI: f64 = 96.0; -pub fn sync_zoom_stops_display_print_size(v: bool) { - ZOOM_STOPS_PRINT_SIZE.store(v, Ordering::Relaxed); +/// The densities a measured display may have, in screen points per inch. A size outside them is +/// a wrong report (a projector or television that gives its aspect ratio as its size, or none). +pub const SCREEN_PPI_RANGE: std::ops::RangeInclusive = 30.0..=1000.0; + +/// The screen points one inch takes at 100% zoom: `None` with Preferences › General › Display +/// Print Size at 100% Zoom off, else the measured density of the display (`screen_ppi`, +/// [`crate::Services::screen_ppi`]), or [`REFERENCE_PPI`] when the display has none. +pub fn print_ppi(display_print_size: bool, screen_ppi: Option) -> Option { + display_print_size.then(|| screen_ppi.filter(|p| SCREEN_PPI_RANGE.contains(p)).unwrap_or(REFERENCE_PPI)) } /// The preset zoom stops, in percent. @@ -125,36 +131,35 @@ pub const ZOOM_STOPS: [f64; 26] = [ ]; /// Document zoom at 100% in the status bar: one screen point per document point, or with -/// Preferences › General › Display Print Size at 100% Zoom, one document inch in 96 screen points. -pub fn zoom_baseline(display_print_size: bool) -> f64 { - if display_print_size { 96.0 / 72.0 } else { 1.0 } +/// Preferences › General › Display Print Size at 100% Zoom ([`print_ppi`] `Some`), one document +/// inch (72 pt) in an inch of the screen, `print` screen points. +pub fn zoom_baseline(print: Option) -> f64 { + print.map_or(1.0, |ppi| ppi / 72.0) } -pub fn zoom_display_percent(z: f64, display_print_size: bool) -> f64 { - z / zoom_baseline(display_print_size) * 100.0 +pub fn zoom_display_percent(z: f64, print: Option) -> f64 { + z / zoom_baseline(print) * 100.0 } -pub fn zoom_from_display_percent(pct: f64, display_print_size: bool) -> f64 { - pct / 100.0 * zoom_baseline(display_print_size) +pub fn zoom_from_display_percent(pct: f64, print: Option) -> f64 { + pct / 100.0 * zoom_baseline(print) } -pub fn next_zoom(z: f64, up: bool) -> f64 { - next_zoom_with_display(z, up, ZOOM_STOPS_PRINT_SIZE.load(Ordering::Relaxed)) -} - -pub fn next_zoom_with_display(z: f64, up: bool, display_print_size: bool) -> f64 { - let pct = zoom_display_percent(z, display_print_size); +/// The preset zoom stop after zoom `z` (`up`) or before it, counted in the percentages the zoom +/// field shows with 100% at [`zoom_baseline`]`(print)`, kept in the zoom range. +pub fn next_zoom(z: f64, up: bool, print: Option) -> f64 { + let pct = zoom_display_percent(z, print); let stop = if up { ZOOM_STOPS.iter().find(|s| **s > pct + 0.01).copied().unwrap_or(64000.0) } else { ZOOM_STOPS.iter().rev().find(|s| **s < pct - 0.01).copied().unwrap_or(3.13) }; - zoom_from_display_percent(stop, display_print_size) + zoom_from_display_percent(stop, print).clamp(0.0313, 640.0) } /// Format for the tab/zoom field: up to 2 decimals, no trailing zeros. -pub fn zoom_label(z: f64, display_print_size: bool) -> String { - let s = format!("{:.2}", zoom_display_percent(z, display_print_size)); +pub fn zoom_label(z: f64, print: Option) -> String { + let s = format!("{:.2}", zoom_display_percent(z, print)); let s = s.trim_end_matches('0').trim_end_matches('.'); format!("{s}%") } @@ -1590,22 +1595,42 @@ mod tests { #[test] fn zoom_steps() { - assert_eq!(next_zoom_with_display(1.0, true, false), 1.5); - assert!((next_zoom_with_display(1.0, false, false) - 0.6667).abs() < 1e-9); - assert_eq!(next_zoom_with_display(640.0, true, false), 640.0); - assert_eq!(zoom_label(0.6667, false), "66.67%"); - assert_eq!(zoom_label(1.0, false), "100%"); - assert_eq!(zoom_label(0.125, false), "12.5%"); + assert_eq!(next_zoom(1.0, true, None), 1.5); + assert!((next_zoom(1.0, false, None) - 0.6667).abs() < 1e-9); + assert_eq!(next_zoom(640.0, true, None), 640.0); + assert_eq!(zoom_label(0.6667, None), "66.67%"); + assert_eq!(zoom_label(1.0, None), "100%"); + assert_eq!(zoom_label(0.125, None), "12.5%"); } /// storytold/vectorcraft#2719: 100% in the zoom field matches Actual Size when Display Print Size is on. #[test] fn zoom_percent_honors_display_print_size_baseline() { - let b = zoom_baseline(true); - assert!((zoom_from_display_percent(100.0, true) - b).abs() < 1e-12); - assert_eq!(zoom_from_display_percent(100.0, false), 1.0); - assert_eq!(zoom_label(b, true), "100%"); - assert_eq!(next_zoom_with_display(b, true, true), zoom_from_display_percent(150.0, true)); + let print = print_ppi(true, None); + let b = zoom_baseline(print); + assert!((zoom_from_display_percent(100.0, print) - b).abs() < 1e-12); + assert_eq!(zoom_from_display_percent(100.0, None), 1.0); + assert_eq!(zoom_label(b, print), "100%"); + assert_eq!(next_zoom(b, true, print), zoom_from_display_percent(150.0, print)); + } + + /// #9051: with Display Print Size on, 100% follows the measured density of the display, so an + /// inch of the document takes as many screen points as an inch of that display holds. A + /// density outside the range a display can have counts as no measurement. + #[test] + fn print_size_follows_the_displays_measured_density() { + assert_eq!(print_ppi(false, Some(127.0)), None, "the preference off ignores the display"); + let (dense, sparse) = (print_ppi(true, Some(127.0)), print_ppi(true, Some(91.0))); + assert!(zoom_baseline(dense) > zoom_baseline(print_ppi(true, None)), "a denser display than the reference zooms 100% further in"); + assert!(zoom_baseline(sparse) < zoom_baseline(print_ppi(true, None)), "a sparser one zooms it out"); + assert!((zoom_baseline(dense) * 72.0 - 127.0).abs() < 1e-9, "an inch of the document fills an inch of the display"); + for wrong in [Some(0.0), Some(-5.0), Some(f64::NAN), Some(f64::INFINITY), Some(5000.0), None] { + assert_eq!(print_ppi(true, wrong), print_ppi(true, None), "{wrong:?} is no measurement"); + } + assert_eq!(zoom_label(zoom_from_display_percent(100.0, dense), dense), "100%"); + let thin = print_ppi(true, Some(40.0)); + assert!(next_zoom(0.04, false, thin) >= 0.0313, "the last stop down stays in the zoom range"); + assert!(next_zoom(600.0, true, print_ppi(true, Some(900.0))) <= 640.0, "and the last stop up"); } #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 5032690fc6..bdafc83ef8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8288,7 +8288,10 @@ control channel's `ui.drag` scrubs), `showHomeScreen` (on by default: the Home s off, an empty window, and the Home button or `app.home` still shows the screen), `autoCollapseIconPanels` (off by default: on, a click away from a panel popped out of the icon column puts it away), `displayPrintSize` (off by default: View › Actual Size / `view.actualSize` is one document point per screen point; on, one document inch fills -96 screen points, an inch at the system's reference density whatever the display scaling). `uiScaling` scales the +an inch of the display that shows the main window, measured from the physical size macOS, Windows, X11 or the +Wayland compositor reports for it and measured again when the window moves to another display, where every +document window keeps its zoom percentage; where the system +reports no size, as on the web, or a size no display has, an inch is 96 screen points). `uiScaling` scales the interface and not the art: a zoom shows the art at the same size at every UI Scaling. The tool shortcut preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s or more, or held while its tool is used, chooses the tool until the key is let go and then returns to the tool active diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f8a3dc84a0..15ad6a5160 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1292,7 +1292,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pen rubber band after a smooth anchor:** the preview segment to the pointer is the curve a click there adds, leaving the last anchor along its outgoing handle and arriving at the new corner anchor without a handle, so the segment keeps its shape when the anchor is placed, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/preview-paths-drawn.html) describes. Before, the preview was a different curve, and the segment changed shape at the click (#8296, in part; `pen::tests::rubber_band_is_the_segment_a_click_adds`); scores and estimates unchanged. - **Pen rubber band over an anchor a click ends on:** over the path's first anchor, the preview segment ends on that anchor, as the closing segment does; over an end of another open path, it ends on that end and arrives along the end's own handle, as the joining segment does. The preview picks these anchors at the pointer before snapping, as a press does. Before, the preview ended at the pointer and arrived without a handle, so the segment moved by up to the pick tolerance at the click, and changed shape when the other end was smooth (#8296, in part; the `pen_rubber_band` tests in `engine/tests/it`); scores and estimates unchanged. - The desktop app keeps the Color panel's Show Options or Hide Options between sessions, and `ui.colorPanel` sets its mode and options as its panel menu does. - - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (off by default: View › Actual Size is one document point per screen point; on, one document inch fills 96 screen points, an inch at the reference density display scaling is set against; `view.actualSize` / `prefs.set`, #394). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). + - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (off by default: View › Actual Size is one document point per screen point; on, one document inch fills an inch of the display that shows the main window, measured from the physical size the system reports for it, or 96 screen points where it reports none; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). - Preferences › General › Scroll Sideways with Cmd/Ctrl + Wheel (on by default; dimmed while Zoom with Mouse Wheel is on): while Zoom with Mouse Wheel is off, Cmd/Ctrl with a mouse wheel's whole notches scrolls the canvas sideways instead of zooming. Alt + Cmd/Ctrl-wheel and a pinch on a Mac trackpad, on a touch screen or in the web build still zoom about the pointer, and once a trackpad gesture holds Alt, it zooms until it ends, also after Alt is let go. Under either wheel preference, Cmd/Ctrl with a touchpad zooms about the pointer. - Preferences › Type › Highlight Substituted Fonts (on by default) paints pink behind text drawn in a substitute for a missing font in every document, and turning it off removes that highlight everywhere (`prefs.set highlightSubstitutedFonts`); Document Setup keeps Highlight Substituted Glyphs ([help](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html)). - Preferences › User Interface › UI Scaling scales the interface ([help](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/modify-workspaces.html)). VectorCraft's own rule is that it leaves the art's size alone: at a given zoom a document point covers the same device pixels at every UI Scaling, so View › Actual Size shows the art at the same size whatever the UI Scaling. A click, a pinch or wheel zoom about the pointer, a pan, the Zoom tool's marquee, Fit, tiled panes, Pixel Preview and the Navigator's view box use the same mapping. Evidence: `canvas::tests_ui_scaling`, `tiled_documents_fit_their_panes_at_every_ui_scaling`, `the_view_box_outlines_the_canvas_at_every_ui_scaling`. Scores unchanged. From 3098776c077cb8526a666ea679e1886fae889084 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 03:22:22 -0800 Subject: [PATCH 2/6] Display Print Size: on by default, each window counts its own display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Preferences › General › Display Print Size at 100% Zoom is now on by default, also for saved preferences that predate the key; a saved choice to turn it off stays off. A document floating in an OS window of its own counts 100% from the display that shows that window. A move of the main window leaves the zoom of floating windows alone, and a window that moves to a display of another density keeps its zoom percentage. The desktop app lists the displays once a second while the preference is on and reads their physical sizes on a background thread when the list changes; the UI thread does not wait for the X11 or Wayland queries. RandR is asked for its version before the CRTC and output queries. A reading that fails is tried again after 10 seconds, and the displays are read again a minute after the last reading, so a display replaced by one that lists the same gets its own size. The Navigator's zoom field, slider and thumbnail clicks count the zoom from Actual Size, as the status bar's zoom field does; before, a click on the thumbnail with the preference on changed the zoom. ui.inspect gives screenPpi and printPpi. The preference's description is updated in every catalog. --- apps/vectorcraft/src/app.rs | 6 +- apps/vectorcraft/src/screen_density.rs | 715 +++++++++++++++--- apps/vectorcraft/src/windows_display_size.rs | 15 +- crates/engine/src/prefs.rs | 4 +- crates/engine/src/tests/prefs_file.rs | 11 + crates/ui-egui/src/app.rs | 3 + crates/ui-egui/src/app/view.rs | 150 +++- crates/ui-egui/src/canvas.rs | 12 +- crates/ui-egui/src/canvas/grid.rs | 13 +- crates/ui-egui/src/canvas/panes.rs | 9 +- crates/ui-egui/src/canvas/tests.rs | 88 ++- crates/ui-egui/src/canvas/tests_ui_scaling.rs | 4 +- crates/ui-egui/src/canvas/view.rs | 8 + crates/ui-egui/src/chrome/status_bar.rs | 4 +- crates/ui-egui/src/chrome/tabs.rs | 2 +- crates/ui-egui/src/chrome/tests.rs | 2 +- crates/ui-egui/src/control.rs | 6 + crates/ui-egui/src/control/tests.rs | 19 +- crates/ui-egui/src/doc_windows.rs | 122 ++- crates/ui-egui/src/doc_windows/tests.rs | 68 ++ crates/ui-egui/src/doc_windows/views.rs | 9 - crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/gu.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/lib.rs | 2 +- crates/ui-egui/src/panels/navigator.rs | 61 +- crates/ui-egui/src/services.rs | 64 +- crates/ui-egui/src/state.rs | 38 +- crates/ui-egui/src/tests/tab_overflow.rs | 2 + crates/ui-egui/src/toolbar/tests.rs | 2 +- docs/mcp.md | 18 +- docs/target-app-parity.md | 2 +- 57 files changed, 1303 insertions(+), 212 deletions(-) diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs index c93a1d0341..8a0267f2cc 100644 --- a/apps/vectorcraft/src/app.rs +++ b/apps/vectorcraft/src/app.rs @@ -208,9 +208,9 @@ impl App { } if let Some(w) = &self.winit_window { self.display_profile.tick(w, now, self.app.session.prefs.monitor_profile_display, &self.app.display_profile, ctx); - if let Some(read) = self.screen_density.tick(w, now) - && self.app.set_screen_ppi(read) - { + if let Some(read) = self.screen_density.tick(w, self.app.session.prefs.display_print_size, ctx) { + self.app.services.screens = read.screens; + self.app.set_screen_reading(read.main); ctx.request_repaint(); } } diff --git a/apps/vectorcraft/src/screen_density.rs b/apps/vectorcraft/src/screen_density.rs index 3a91f7f4d4..c89934a3c7 100644 --- a/apps/vectorcraft/src/screen_density.rs +++ b/apps/vectorcraft/src/screen_density.rs @@ -1,6 +1,7 @@ -//! The density of the display that shows most of the main window, in the window's points per -//! inch, for Preferences › General › Display Print Size at 100% Zoom (`Services::screen_ppi`): -//! the display's size in points divided by the physical size the system reports for it. +//! The densities of the connected displays, in points (at each display's scale factor) per inch, +//! for Preferences › General › Display Print Size at 100% Zoom (`Services::screen_ppi` for the +//! display that shows most of the main window, `Services::screens` for every display): a +//! display's size in points divided by the physical size the system reports for it. //! //! - macOS: `CGDisplayScreenSize`. //! - Windows: `GetDpiForMonitor`'s raw density (`windows_display_size`). @@ -8,15 +9,26 @@ //! - Wayland: the physical width and height of the compositor's `wl_output` for the display. //! //! A display that reports no size, or a size no display has, gives `None`, and an inch then takes -//! 96 points. The window's display is looked up once a second while the app draws, and read when -//! it changes. +//! 96 points. While the preference is on, the displays are listed once a second while the app +//! draws. When the list changes, a background thread reads every display's size, and a later +//! frame takes the result. A reading that fails is tried again after [`RETRY_AFTER`] seconds. +use std::sync::mpsc::{Receiver, TryRecvError}; + +use vectorcraft_ui_egui::{ScreenDensity, ScreenPpi}; use winit::dpi::{PhysicalPosition, PhysicalSize}; use winit::monitor::MonitorHandle; -/// Seconds between two checks of which display shows the window. +/// Seconds between two listings of the displays. const LOOK_EVERY: f64 = 1.0; +/// Seconds after a failed reading before the same displays are read again. +const RETRY_AFTER: f64 = 10.0; + +/// Seconds after a reading before the same displays are read again: a display can be replaced by +/// one the listing cannot tell apart (the same connector, resolution and scale). +const READ_AGAIN_AFTER: f64 = 60.0; + /// Millimeters in an inch. const MM_PER_INCH: f64 = 25.4; @@ -24,49 +36,266 @@ const MM_PER_INCH: f64 = 25.4; /// larger: square pixels on a display that reports its true size give two densities this close. const AXES_AGREE: f64 = 0.1; -/// What identifies the display and the window's scale on it between two looks. -type Shown = (Option, PhysicalPosition, PhysicalSize, u64); - -/// Keeps the density current from the main window's frames. -#[derive(Default)] -pub(crate) struct Tracker { - /// When the window's display was last looked up. - looked: Option, - /// The display read last, with the window's scale factor then. - shown: Option, +/// A connected display as winit lists it: what a reading needs, and what tells two lists apart. +#[derive(Clone, Debug, PartialEq)] +pub(crate) struct Display { + name: Option, + position: PhysicalPosition, + size: PhysicalSize, + /// The display's scale factor, as its bits. + scale: u64, + /// The system's id of the display ([`native_id`]). + id: i64, } -impl Tracker { - /// Looks up the window's display when a look is due at `now` (seconds), and returns its - /// density (`None` inside for a display that reports no size) when the display or the - /// window's scale changed since the last reading. - pub(crate) fn tick(&mut self, window: &winit::window::Window, now: f64) -> Option> { - if self.looked.is_some_and(|at| (at..at + LOOK_EVERY).contains(&now)) { - return None; - } - self.looked = Some(now); - let monitor = window.current_monitor(); - let scale = window.scale_factor(); - let shown = monitor.as_ref().map(|m| (m.name(), m.position(), m.size(), scale.to_bits())); - if shown == self.shown { - return None; - } - self.shown = shown; - let read = monitor.and_then(|m| points_per_inch(m.size(), scale, physical_mm(window, &m)?)); - match read { - Some(p) => log::info!("the window's display has {p:.1} points to an inch"), - None => log::info!("the window's display reports no physical size; an inch is 96 points"), - } - Some(read) +impl Display { + fn of(m: &MonitorHandle) -> Self { + Self { name: m.name(), position: m.position(), size: m.size(), scale: m.scale_factor().to_bits(), id: native_id(m) } } } -/// The density, in points per inch, of a display `size` physical pixels wide and high, with the -/// window drawn at `scale` pixels to a point, that the system says is `mm` millimeters wide and -/// high. `None` for a size that is no display's: zero or less, an aspect ratio given in place of -/// the size (16 × 9, 160 × 90 and the like), axes whose densities disagree in either orientation, -/// or a density outside [`vectorcraft_ui_egui::state::SCREEN_PPI_RANGE`]. A display turned a -/// quarter turn may report the size of its panel upright, so the axes are also tried swapped. +/// One display's physical size in millimeters: `None` when the system reports none, an error when +/// asking for it failed. +type Size = Result, String>; + +/// The physical sizes of displays, one for each display read, or why none could be read. +type Reading = Result, String>; + +/// What the host hands the app: the density of the main window's display, unread while that +/// display is unknown or has not answered yet, and every display's that answered. +#[derive(Clone, Debug, PartialEq)] +pub(crate) struct Densities { + pub(crate) main: ScreenPpi, + pub(crate) screens: Vec, +} + +/// What a display answered: its physical size (`Some(None)` for none), or `None` while it has not +/// answered. +type Answer = Option>; + +/// What a listing gives: the displays, the one that shows most of the main window, and the main +/// window's scale factor. +type Listing = (Vec, Option, f64); + +/// Keeps the densities current from the main window's frames. +#[derive(Default)] +pub(crate) struct Tracker { + /// When the displays were last listed. + looked: Option, + /// The display that showed most of the main window at the last listing, and the window's scale + /// factor then. + current: Option<(Display, f64)>, + /// The displays of the last reading that finished, each with what it answered. + read: Option>, + /// The displays of the last reading that failed, and when it failed. + failed: Option<(Vec, f64)>, + /// The reading in progress: the displays it reads, and where its result arrives. + running: Option<(Vec, Receiver)>, + /// The reading in progress started before the preference was last turned off: its result is + /// dropped when it arrives, and no other reading starts until then. + obsolete: bool, + /// What [`Self::tick`] returned last. + reported: Option, + /// The displays of the last listing. + listed: Option>, + /// When the last reading that finished ended. + read_at: f64, + /// When the first tick ran: the tracker's clock, which runs while the window draws nothing. + origin: Option, +} + +impl Tracker { + /// Lists the displays when a listing is due and Display Print Size is `enabled`, starts a + /// reading on a background thread when they changed, and returns the densities when they + /// differ from what it returned before. The thread asks `ctx` for a frame when its reading is + /// ready. + pub(crate) fn tick(&mut self, window: &winit::window::Window, enabled: bool, ctx: &egui::Context) -> Option { + let now = self.origin.get_or_insert_with(std::time::Instant::now).elapsed().as_secs_f64(); + let list = || { + // winit stops on a display that went away while it is being asked about (Windows); that + // listing is dropped, and the next one is made a second later. + let listing = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + let current = window.current_monitor().map(|m| Display::of(&m)); + (window.available_monitors().map(|m| Display::of(&m)).collect::>(), current, window.scale_factor()) + })); + listing.map_err(|_| log::debug!("a display went away while the displays were listed")).ok() + }; + let wayland = is_wayland(window); + let start = |displays: Vec| { + let (tx, rx) = std::sync::mpsc::channel(); + let ctx = ctx.clone(); + let spawned = std::thread::Builder::new().name("display size".into()).spawn(move || { + // The app may have quit, and dropped the receiver, before the reading ends. + let _ = tx.send(read_all(&displays, wayland)); + ctx.request_repaint(); + }); + spawned.map(|_| rx).map_err(|e| format!("couldn't start reading the displays' sizes: {e}")) + }; + let densities = self.update(now, enabled, list, start); + // A failed reading is tried again at a listing RETRY_AFTER seconds later, also in an app + // that is not drawing. A reading in progress asks for a frame when it ends. + if enabled + && self.running.is_none() + && let Some((_, at)) = &self.failed + { + let due = (at + RETRY_AFTER).max(self.looked.map_or(0.0, |l| l + LOOK_EVERY)); + ctx.request_repaint_after(std::time::Duration::from_secs_f64((due - now).clamp(0.0, RETRY_AFTER))); + } + densities + } + + /// [`Self::tick`] with the listing (`list`) and the start of a reading (`start`) passed in. + fn update( + &mut self, + now: f64, + enabled: bool, + list: impl FnOnce() -> Option, + start: impl FnOnce(Vec) -> Result, String>, + ) -> Option { + let was_running = self.running.is_some(); + if let Some((displays, rx)) = self.running.take() { + match rx.try_recv() { + Err(TryRecvError::Empty) => self.running = Some((displays, rx)), + _ if self.obsolete => self.obsolete = false, + Ok(Ok(sizes)) => { + // A display whose size could not be read keeps what an earlier reading gave it, + // or stays unanswered, until the reading is tried again. + let mut failed = false; + let read: Vec<_> = displays + .iter() + .zip(sizes.into_iter().chain(std::iter::repeat(Ok(None)))) + .map(|(d, s)| { + let mm = s.map(Some).unwrap_or_else(|e| { + log::debug!("couldn't read a display's physical size: {e}"); + failed = true; + self.earlier(d) + }); + (d.clone(), mm) + }) + .collect(); + self.failed = failed.then_some((displays, now)); + self.read = Some(read); + self.read_at = now; + } + Ok(Err(e)) => { + log::debug!("couldn't read the displays' physical sizes: {e}"); + self.fail(displays, now); + } + Err(TryRecvError::Disconnected) => { + log::debug!("the reading of the displays' physical sizes stopped without a result"); + self.fail(displays, now); + } + } + } + // When a reading ends, the displays are listed again at once: they may have changed while + // it ran, and the frame its end asked for may be the last one for a while. + if was_running && self.running.is_none() { + self.looked = None; + } + if !enabled { + // Turned on again, the displays are read and the densities reported anew: a display + // may have been replaced meanwhile by one that lists the same. + self.reported = None; + self.read = None; + self.failed = None; + self.looked = None; + self.obsolete = self.running.is_some(); + return None; + } + // The densities change only at a listing, and one follows the end of every reading. + let listing = !self.looked.is_some_and(|at| (at..at + LOOK_EVERY).contains(&now)); + if !listing && self.reported.is_some() { + return None; + } + if listing { + self.looked = Some(now); + } + if let Some((displays, current, scale)) = listing.then(list).flatten() { + // winit can give the window's display as it was before a change of resolution: the + // display is found in the listing by its id and name. + let current = current.map(|c| displays.iter().find(|d| d.id == c.id && d.name == c.name).cloned().unwrap_or(c)); + self.current = current.map(|c| (c, scale)); + self.listed = Some(displays.clone()); + // These displays are read once, and again RETRY_AFTER seconds after a reading of them + // failed in whole or in part. + let known = self.read.as_ref().is_some_and(|r| r.iter().map(|(d, _)| d).eq(displays.iter())); + let due = match &self.failed { + Some((d, at)) if *d == displays => !(*at..*at + RETRY_AFTER).contains(&now), + _ => !known || now - self.read_at >= READ_AGAIN_AFTER, + }; + if self.running.is_none() && due { + match start(displays.clone()) { + Ok(rx) => self.running = Some((displays, rx)), + Err(e) => { + log::warn!("{e}"); + self.fail(displays, now); + } + } + } + } + let read = self.read.as_ref()?; + // The main window counts in its own scale factor, which on Wayland can be a fraction where + // the display gives a whole number. A window on no display (a Wayland window before it is + // shown, or after its display went), or on one that is being read or has not answered, has + // its density unread. + let main = match &self.current { + Some((c, scale)) => match read.iter().find(|(d, _)| d == c) { + Some((d, Some(mm))) => ScreenPpi::Read(mm.and_then(|mm| points_per_inch(d.size, *scale, mm))), + _ => ScreenPpi::Unread, + }, + None => ScreenPpi::Unread, + }; + // The displays where the last listing has them, each with what the reading of it gave; a + // display the readings have not reached yet is unread. + let listed = self.listed.as_deref().unwrap_or_default(); + let screens = listed + .iter() + .map(|d| { + let [w, h] = [d.size.width, d.size.height].map(|v| i32::try_from(v).unwrap_or(i32::MAX)); + let scale = f64::from_bits(d.scale); + let mm = read.iter().find(|(e, _)| e == d).and_then(|(_, mm)| *mm); + let ppi = mm.map_or(ScreenPpi::Unread, |mm| ScreenPpi::Read(mm.and_then(|mm| points_per_inch(d.size, scale, mm)))); + ScreenDensity { rect: [d.position.x, d.position.y, w, h], scale, ppi } + }) + .collect(); + let densities = Densities { main, screens }; + if self.reported.as_ref() == Some(&densities) { + return None; + } + match main { + ScreenPpi::Read(Some(p)) => log::info!("the window's display has {p:.1} points to an inch"), + ScreenPpi::Read(None) => log::info!("the window's display reports no physical size; an inch is 96 points"), + ScreenPpi::Unread => log::info!("the window's display has not been read; an inch is 96 points"), + } + self.reported = Some(densities.clone()); + Some(densities) + } +} + +impl Tracker { + /// What the last reading gave display `d`, when it answered. + fn earlier(&self, d: &Display) -> Answer { + self.read.as_ref()?.iter().find(|(e, _)| e == d)?.1 + } + + /// Records that reading `displays` failed at `now`; they are read again after [`RETRY_AFTER`] + /// seconds. After an earlier reading, they become the displays known, each with what that + /// reading gave it, if anything. Before any reading, nothing is reported yet. + fn fail(&mut self, displays: Vec, now: f64) { + if self.read.is_some() { + let read = displays.iter().map(|d| (d.clone(), self.earlier(d))).collect(); + self.read = Some(read); + } + self.failed = Some((displays, now)); + } +} + +/// The density, in points per inch, of a display `size` physical pixels wide and high, drawn at +/// `scale` pixels to a point, that the system says is `mm` millimeters wide and high. `None` for a +/// size that is no display's: zero or less, an aspect ratio given in place of the size (16 × 9, +/// 160 × 90 and the like), axes whose densities disagree in either orientation, or a density +/// outside [`vectorcraft_ui_egui::state::SCREEN_PPI_RANGE`]. A display turned a quarter turn may +/// report the size of its panel upright, so the axes are also tried swapped. pub(crate) fn points_per_inch(size: PhysicalSize, scale: f64, mm: [f64; 2]) -> Option { if !(scale.is_finite() && scale > 0.0) || mm.iter().any(|v| !(v.is_finite() && *v > 0.0)) || aspect_as_size(mm) { return None; @@ -87,59 +316,105 @@ fn aspect_as_size(mm: [f64; 2]) -> bool { RATIOS.iter().any(|r| [1.0, 10.0].iter().any(|k| sorted == [r[0] * k, r[1] * k])) } -/// The physical width and height, in millimeters, the system reports for `monitor`. +/// Whether `window` is a Wayland window, whose displays the compositor describes. +#[cfg(target_os = "linux")] +fn is_wayland(window: &winit::window::Window) -> bool { + use winit::raw_window_handle::{HasWindowHandle as _, RawWindowHandle}; + window.window_handle().ok().is_some_and(|h| matches!(h.as_raw(), RawWindowHandle::Wayland(_))) +} + +#[cfg(not(target_os = "linux"))] +fn is_wayland(_: &winit::window::Window) -> bool { + false +} + +/// The system's id of `monitor`: the display id on macOS, the monitor handle on Windows, the RandR +/// CRTC on X11. #[cfg(target_os = "macos")] -fn physical_mm(_: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { +fn native_id(monitor: &MonitorHandle) -> i64 { use winit::platform::macos::MonitorHandleExtMacOS as _; - let size = objc2_core_graphics::CGDisplayScreenSize(monitor.native_id()); - Some([size.width, size.height]) + i64::from(monitor.native_id()) } #[cfg(windows)] -fn physical_mm(_: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { +fn native_id(monitor: &MonitorHandle) -> i64 { use winit::platform::windows::MonitorHandleExtWindows as _; - let [x, y] = crate::windows_display_size::raw_dpi(monitor.hmonitor())?; - let size = monitor.size(); - Some([f64::from(size.width) / x * MM_PER_INCH, f64::from(size.height) / y * MM_PER_INCH]) + monitor.hmonitor() as i64 } #[cfg(target_os = "linux")] -fn physical_mm(window: &winit::window::Window, monitor: &MonitorHandle) -> Option<[f64; 2]> { - use winit::raw_window_handle::{HasWindowHandle as _, RawWindowHandle}; - let wayland = window.window_handle().ok().is_some_and(|h| matches!(h.as_raw(), RawWindowHandle::Wayland(_))); - let read = if wayland { wayland::physical_mm(monitor.name().as_deref()) } else { x11::physical_mm(monitor) }; - read.unwrap_or_else(|e| { - log::debug!("couldn't read the display's physical size: {e}"); - None - }) +fn native_id(monitor: &MonitorHandle) -> i64 { + use winit::platform::x11::MonitorHandleExtX11 as _; + i64::from(monitor.native_id()) } #[cfg(not(any(target_os = "macos", windows, target_os = "linux")))] -fn physical_mm(_: &winit::window::Window, _: &MonitorHandle) -> Option<[f64; 2]> { - None +fn native_id(_: &MonitorHandle) -> i64 { + 0 +} + +/// The physical width and height, in millimeters, the system reports for each of `displays`. +#[cfg(target_os = "macos")] +fn read_all(displays: &[Display], _: bool) -> Reading { + Ok(displays + .iter() + .map(|d| { + Ok(u32::try_from(d.id).ok().map(|id| { + let size = objc2_core_graphics::CGDisplayScreenSize(id); + [size.width, size.height] + })) + }) + .collect()) +} + +#[cfg(windows)] +fn read_all(displays: &[Display], _: bool) -> Reading { + Ok(displays + .iter() + .map(|d| { + let dpi = crate::windows_display_size::raw_dpi(d.id as isize)?; + Ok(dpi.map(|[x, y]| [f64::from(d.size.width) / x * MM_PER_INCH, f64::from(d.size.height) / y * MM_PER_INCH])) + }) + .collect()) +} + +#[cfg(target_os = "linux")] +fn read_all(displays: &[Display], wayland: bool) -> Reading { + if wayland { wayland::read_all(displays) } else { x11::read_all(displays) } +} + +#[cfg(not(any(target_os = "macos", windows, target_os = "linux")))] +fn read_all(displays: &[Display], _: bool) -> Reading { + Ok(displays.iter().map(|_| Ok(None)).collect()) } #[cfg(target_os = "linux")] mod x11 { - use winit::monitor::MonitorHandle; - use winit::platform::x11::MonitorHandleExtX11 as _; use x11rb::CURRENT_TIME; use x11rb::protocol::randr; - /// The millimeters RandR reports for the first output of the CRTC that shows `monitor`. - pub(super) fn physical_mm(monitor: &MonitorHandle) -> Result, String> { + use super::{Display, Reading, Size}; + + /// The millimeters RandR reports for the first output of each display's CRTC. + pub(super) fn read_all(displays: &[Display]) -> Reading { let (conn, _) = x11rb::connect(None).map_err(|e| format!("couldn't connect to the X11 display: {e}"))?; let ask = |e: x11rb::errors::ConnectionError| format!("couldn't ask the X11 display: {e}"); - let crtc = randr::get_crtc_info(&conn, monitor.native_id(), CURRENT_TIME) - .map_err(ask)? - .reply() - .map_err(|e| format!("the X11 display has no such CRTC: {e}"))?; - let Some(output) = crtc.outputs.first() else { return Ok(None) }; - let info = randr::get_output_info(&conn, *output, CURRENT_TIME) - .map_err(ask)? - .reply() - .map_err(|e| format!("the X11 display has no such output: {e}"))?; - Ok(Some([f64::from(info.mm_width), f64::from(info.mm_height)])) + // RandR answers only a client that gave the version it speaks; 1.2 has CRTCs and outputs. + randr::query_version(&conn, 1, 2).map_err(ask)?.reply().map_err(|e| format!("the X11 display has no RandR 1.2: {e}"))?; + let size = |d: &Display| -> Size { + let Ok(crtc) = u32::try_from(d.id) else { return Ok(None) }; + let info = randr::get_crtc_info(&conn, crtc, CURRENT_TIME) + .map_err(ask)? + .reply() + .map_err(|e| format!("the X11 display has no such CRTC: {e}"))?; + let Some(output) = info.outputs.first() else { return Ok(None) }; + let info = randr::get_output_info(&conn, *output, CURRENT_TIME) + .map_err(ask)? + .reply() + .map_err(|e| format!("the X11 display has no such output: {e}"))?; + Ok(Some([f64::from(info.mm_width), f64::from(info.mm_height)])) + }; + Ok(displays.iter().map(size).collect()) } } @@ -150,9 +425,12 @@ mod wayland { use wayland_client::protocol::wl_registry::{self, WlRegistry}; use wayland_client::{Connection, Dispatch, QueueHandle}; - /// The physical size the compositor gives for the output named `name`, asked on a connection - /// of its own; with no name, or a compositor that names no outputs, the only output's. - pub(super) fn physical_mm(name: Option<&str>) -> Result, String> { + use super::{Display, Reading}; + + /// The physical size the compositor gives for the output of each display's name, asked on a + /// connection of its own; with no name, or a compositor that names no outputs, the only + /// output's. + pub(super) fn read_all(displays: &[Display]) -> Reading { let conn = Connection::connect_to_env().map_err(|e| format!("no Wayland compositor: {e}"))?; let (globals, mut queue) = registry_queue_init::(&conn).map_err(|e| e.to_string())?; let qh = queue.handle(); @@ -165,12 +443,18 @@ mod wayland { // The compositor sends each output's geometry, name and `done` in reply to the bind. queue.roundtrip(&mut state).map_err(|e| e.to_string())?; let found: Vec<&Output> = state.outputs.iter().map(|(_, o)| o).collect(); - let pick = match name { - Some(name) if found.iter().any(|o| o.name.is_some()) => found.iter().find(|o| o.name.as_deref() == Some(name)), - _ if found.len() == 1 => found.first(), - _ => None, - }; - Ok(pick.and_then(|o| o.mm)) + let named = found.iter().any(|o| o.name.is_some()); + Ok(displays + .iter() + .map(|d| { + let pick = match d.name.as_deref() { + Some(name) if named => found.iter().find(|o| o.name.as_deref() == Some(name)), + _ if found.len() == 1 => found.first(), + _ => None, + }; + Ok(pick.and_then(|o| o.mm)) + }) + .collect()) } /// One output's name and physical size. @@ -206,6 +490,9 @@ mod wayland { #[cfg(test)] mod tests { + use std::cell::Cell; + use std::sync::mpsc::{Sender, channel}; + use super::*; /// A 14-inch laptop panel at twice its points: 3024 × 1964 pixels, 302 × 196 mm, draws 127 @@ -249,4 +536,262 @@ mod tests { assert_eq!(points_per_inch(PhysicalSize::new(100, 56), 1.0, [5270.0, 2960.0]), None, "under the range"); assert_eq!(points_per_inch(PhysicalSize::new(7680, 4320), 1.0, [53.0, 30.0]), None, "over it"); } + + /// A 1920 × 1080 display at scale 1 and position `x`, named `name`. + fn display(name: &str, x: i32) -> Display { + Display { + name: Some(name.into()), + position: PhysicalPosition::new(x, 0), + size: PhysicalSize::new(1920, 1080), + scale: 1.0f64.to_bits(), + id: 0, + } + } + + /// The sizes of a 24-inch display (about 92 points to an inch) and a 27-inch one (about 82). + const SIZES: [[f64; 2]; 2] = [[531.0, 299.0], [598.0, 336.0]]; + + /// A reading that gives every display one of [`SIZES`], in turn. + fn sizes(n: usize) -> Reading { + Ok((0..n).map(|i| Ok(Some(SIZES[i % SIZES.len()]))).collect()) + } + + /// Drives a tracker: counts its listings and readings, and hands out the sender of the reading + /// it started last. + struct Rig { + tracker: Tracker, + displays: Vec, + current: usize, + /// The window's display as winit last gave it, when that lags behind the listing. + lagging: Option, + window_scale: f64, + lists: Cell, + reads: Cell, + sender: Option>, + fail_to_start: bool, + } + + impl Rig { + fn new() -> Self { + Self { + tracker: Tracker::default(), + displays: vec![display("left", 0), display("right", 1920)], + current: 0, + lagging: None, + window_scale: 1.0, + lists: Cell::new(0), + reads: Cell::new(0), + sender: None, + fail_to_start: false, + } + } + + fn tick(&mut self, now: f64, enabled: bool) -> Option { + let current = self.lagging.clone().or_else(|| self.displays.get(self.current).cloned()); + let (displays, scale) = (self.displays.clone(), self.window_scale); + let (lists, reads, fail) = (&self.lists, &self.reads, self.fail_to_start); + let mut sender = None; + let out = self.tracker.update( + now, + enabled, + || { + lists.set(lists.get() + 1); + Some((displays, current, scale)) + }, + |_| { + reads.set(reads.get() + 1); + if fail { + return Err("no thread".into()); + } + let (tx, rx) = channel(); + sender = Some(tx); + Ok(rx) + }, + ); + if sender.is_some() { + self.sender = sender; + } + out + } + + fn finish(&mut self, reading: Reading) { + if let Some(tx) = self.sender.take() { + tx.send(reading).unwrap(); + } + } + } + + /// The first listing starts a reading, and the densities arrive once the reading ends, without + /// a frame waiting for it. The main window's density is its display's, and every display gets + /// its own. + #[test] + fn the_densities_arrive_when_the_reading_ends() { + let mut rig = Rig::new(); + assert_eq!(rig.tick(0.0, true), None, "the reading runs in the background"); + assert_eq!(rig.reads.get(), 1); + assert_eq!(rig.tick(2.0, true), None, "still running: no second reading"); + assert_eq!(rig.reads.get(), 1); + rig.finish(sizes(2)); + let got = rig.tick(2.1, true).unwrap_or_else(|| panic!("the densities")); + let ppi = got.screens.iter().map(|s| s.ppi.ppi().unwrap_or(0.0)).collect::>(); + assert!(ppi[0] > ppi[1] && ppi[1] > 0.0, "the smaller display is denser: {ppi:?}"); + assert_eq!(got.main, ScreenPpi::Read(Some(ppi[0])), "the main window is on the left display"); + assert_eq!(got.screens[1].rect, [1920, 0, 1920, 1080]); + assert_eq!(rig.tick(5.0, true), None, "nothing changed"); + assert_eq!(rig.reads.get(), 1, "the same displays are not read again"); + assert_eq!(rig.tick(5.2, false), None, "off, nothing is reported"); + assert_eq!(rig.tick(5.4, true), None, "turned on again, the displays are read again at once"); + assert_eq!(rig.reads.get(), 2); + rig.finish(sizes(2)); + assert_eq!(rig.tick(5.5, true), Some(got), "and the densities reported anew"); + } + + /// The displays are listed at most once a second, and not at all with the preference off. + #[test] + fn the_displays_are_listed_once_a_second_while_the_preference_is_on() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.tick(0.5, true); + assert_eq!(rig.lists.get(), 1); + rig.tick(1.0, true); + assert_eq!(rig.lists.get(), 2); + rig.tick(5.0, false); + assert_eq!(rig.lists.get(), 2, "off, nothing is asked of the system"); + } + + /// The main window moving to the other display reports that display's density without a new + /// reading; a display joining the list is read again, and while a display that changed is + /// read, the densities reported before stay. + #[test] + fn a_change_of_display_is_reported() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.finish(sizes(2)); + let left = rig.tick(0.1, true).and_then(|d| d.main.ppi()); + rig.current = 1; + let right = rig.tick(1.5, true).and_then(|d| d.main.ppi()); + assert!(left.is_some() && right.is_some() && left != right, "{left:?} then {right:?}"); + assert_eq!(rig.reads.get(), 1); + // A window drawn at 1.5 pixels a point (a fractional scale the display does not list) + // has fewer points to an inch than the display's own scale of 1 gives. + rig.window_scale = 1.5; + let scaled = rig.tick(2.6, true).and_then(|d| d.main.ppi()); + assert!(scaled.zip(right).is_some_and(|(s, r)| (s * 1.5 - r).abs() < 1e-9), "{scaled:?} at 1.5, {right:?} at 1"); + rig.window_scale = 1.0; + rig.displays.push(display("third", 3840)); + rig.tick(4.0, true); + assert_eq!(rig.reads.get(), 2, "a new display is read"); + rig.finish(sizes(3)); + rig.tick(4.5, true); + // The window's display changes resolution: until it is read again its density is unread. + rig.displays[1].size = PhysicalSize::new(2560, 1440); + assert_eq!(rig.tick(6.0, true).map(|d| d.main), Some(ScreenPpi::Unread), "the display is being read"); + assert_eq!(rig.reads.get(), 3); + rig.finish(sizes(3)); + let sharper = rig.tick(6.1, true).and_then(|d| d.main.ppi()); + assert!(sharper.zip(right).is_some_and(|(s, r)| s > r), "more pixels on the same glass: {sharper:?}, {right:?}"); + // winit still gives the window's display at its old resolution: it is found by its name. + let mut old = rig.displays[1].clone(); + old.size = PhysicalSize::new(1920, 1080); + rig.lagging = Some(old); + rig.window_scale = 1.25; + let lagging = rig.tick(7.2, true).and_then(|d| d.main.ppi()); + assert!(lagging.zip(sharper).is_some_and(|(l, s)| (l * 1.25 - s).abs() < 1e-9), "{lagging:?} from {sharper:?}"); + rig.lagging = None; + // It changes again and this time the reading fails: its density is unread. + rig.displays[1].size = PhysicalSize::new(3840, 2160); + let reading = rig.tick(8.5, true).unwrap_or_else(|| panic!("a report")); + assert_eq!(reading.main, ScreenPpi::Unread, "the display is being read: {reading:?}"); + assert!(reading.screens.iter().any(|s| s.rect[2] == 3840 && s.ppi == ScreenPpi::Unread), "listed where it is now, unread: {reading:?}"); + rig.finish(Err("the display server went away".into())); + assert_eq!(rig.tick(8.6, true), None, "the failed reading leaves it unread"); + } + + /// A display that changes while a reading runs is read as soon as that reading ends. + #[test] + fn a_change_during_a_reading_is_read_when_it_ends() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.displays[1].size = PhysicalSize::new(2560, 1440); + rig.tick(1.0, true); + assert_eq!(rig.reads.get(), 1, "one reading at a time"); + rig.finish(sizes(2)); + rig.tick(1.2, true); + assert_eq!(rig.reads.get(), 2, "the changed display is read at once"); + } + + /// A display whose size could not be read does not hold back the others, and the displays are + /// read again after a while. + #[test] + fn one_display_that_fails_leaves_the_others() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.finish(Ok(vec![Ok(Some(SIZES[0])), Err("no answer".into())])); + let got = rig.tick(0.1, true).unwrap_or_else(|| panic!("the densities")); + assert!(got.main.ppi().is_some() && got.screens[1].ppi == ScreenPpi::Unread, "the display that did not answer is unread: {got:?}"); + rig.tick(5.0, true); + assert_eq!(rig.reads.get(), 1, "not again at once"); + rig.tick(0.1 + RETRY_AFTER, true); + assert_eq!(rig.reads.get(), 2, "tried again"); + rig.finish(sizes(2)); + let full = rig.tick(11.0, true).unwrap_or_else(|| panic!("the densities")); + assert!(full.screens.iter().all(|s| s.ppi.ppi().is_some()), "{full:?}"); + rig.tick(30.0, true); + assert_eq!(rig.reads.get(), 2, "and left alone once every display was read"); + // A display joins, and the window's display, unchanged, fails to answer: it keeps its size. + rig.displays.push(display("third", 3840)); + rig.tick(32.0, true); + rig.finish(Ok(vec![Err("no answer".into()), Ok(Some(SIZES[1])), Ok(Some(SIZES[0]))])); + let kept = rig.tick(32.1, true).unwrap_or_else(|| panic!("the densities")); + assert!(kept.main.ppi().is_some() && kept.main == full.main, "{kept:?}"); + // A window on no display has its density unread. + rig.current = 9; + assert_eq!(rig.tick(34.0, true).map(|d| d.main), Some(ScreenPpi::Unread)); + // The window's display fails to answer the first reading: its density is unread, not a + // display without a size. + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.finish(Ok(vec![Err("no answer".into()), Ok(Some(SIZES[1]))])); + let first = rig.tick(0.1, true).unwrap_or_else(|| panic!("the densities")); + assert_eq!((first.main, first.screens[0].ppi), (ScreenPpi::Unread, ScreenPpi::Unread), "{first:?}"); + } + + /// A reading that fails, or a thread that cannot start, is tried again after a while; the + /// same displays are not read on every listing until then. + #[test] + fn a_failed_reading_is_tried_again() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.finish(Err("the display server went away".into())); + assert_eq!(rig.tick(1.0, true), None); + assert_eq!(rig.reads.get(), 1, "not again at once"); + rig.tick(5.0, true); + assert_eq!(rig.reads.get(), 1); + rig.tick(1.0 + RETRY_AFTER, true); + assert_eq!(rig.reads.get(), 2, "tried again"); + rig.finish(sizes(2)); + assert!(rig.tick(12.0, true).is_some_and(|d| d.main.ppi().is_some()), "and read"); + let mut rig = Rig::new(); + rig.fail_to_start = true; + rig.tick(0.0, true); + rig.tick(1.0 + RETRY_AFTER, true); + assert_eq!(rig.reads.get(), 2, "a thread that did not start is tried again too"); + } + + /// Displays that list the same are read again a while after the last reading, so a display + /// replaced by one on the same connector at the same resolution and scale gets its own size. + #[test] + fn displays_that_list_the_same_are_read_again_after_a_while() { + let mut rig = Rig::new(); + rig.tick(0.0, true); + rig.finish(sizes(2)); + let first = rig.tick(0.1, true).unwrap_or_else(|| panic!("the densities")); + rig.tick(0.1 + READ_AGAIN_AFTER - 1.0, true); + assert_eq!(rig.reads.get(), 1, "not before the time is up"); + rig.tick(0.1 + READ_AGAIN_AFTER, true); + assert_eq!(rig.reads.get(), 2, "read again"); + rig.finish(Ok(vec![Ok(Some(SIZES[1])), Ok(Some(SIZES[0]))])); + let replaced = rig.tick(0.2 + READ_AGAIN_AFTER, true).unwrap_or_else(|| panic!("the densities")); + assert!(replaced.main.ppi().is_some() && replaced.main != first.main, "the new panel's density: {first:?} then {replaced:?}"); + } } diff --git a/apps/vectorcraft/src/windows_display_size.rs b/apps/vectorcraft/src/windows_display_size.rs index a46c7989b2..fc7041ebd6 100644 --- a/apps/vectorcraft/src/windows_display_size.rs +++ b/apps/vectorcraft/src/windows_display_size.rs @@ -7,13 +7,14 @@ use windows::Win32::Graphics::Gdi::HMONITOR; use windows::Win32::UI::HiDpi::{GetDpiForMonitor, MDT_RAW_DPI}; -/// The horizontal and vertical pixels per inch of the monitor winit's handle `monitor` names, or -/// `None` when Windows reports none for it. -pub(crate) fn raw_dpi(monitor: isize) -> Option<[f64; 2]> { +/// The horizontal and vertical pixels per inch of the monitor winit's handle `monitor` names: +/// `None` when Windows reports no density for it, an error when the call fails. +pub(crate) fn raw_dpi(monitor: isize) -> Result, String> { let (mut x, mut y) = (0u32, 0u32); // SAFETY: `monitor` is a handle winit got from Windows for a connected monitor; a handle that - // has gone stale makes the call fail, which returns `None`. Both pointers point at live `u32`s - // for the length of the call. - unsafe { GetDpiForMonitor(HMONITOR(monitor as *mut core::ffi::c_void), MDT_RAW_DPI, &mut x, &mut y) }.ok()?; - (x > 0 && y > 0).then(|| [f64::from(x), f64::from(y)]) + // has gone stale makes the call fail, which returns an error. Both pointers point at live + // `u32`s for the length of the call. + unsafe { GetDpiForMonitor(HMONITOR(monitor as *mut core::ffi::c_void), MDT_RAW_DPI, &mut x, &mut y) } + .map_err(|e| format!("couldn't read a monitor's density: {e}"))?; + Ok((x > 0 && y > 0).then(|| [f64::from(x), f64::from(y)])) } diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 2e0d0f9fe4..3abe86edee 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -84,6 +84,8 @@ pub struct Prefs { /// Artboard Options › Update While Dragging: the area outside the artboards stays darker while /// the Artboard tool moves or resizes an artboard; off, it draws as usual until the drag ends. pub artboard_update_while_dragging: bool, + /// General › Display Print Size at 100% Zoom (on by default): 100% shows an inch of the + /// document in an inch of the display. A preferences file without the key reads as on. pub display_print_size: bool, pub double_click_to_isolate: bool, pub transform_pattern_tiles: bool, @@ -477,7 +479,7 @@ impl Default for Prefs { type_glyph_bounds: false, fade_region_outside_artboard: true, artboard_update_while_dragging: true, - display_print_size: false, + display_print_size: true, double_click_to_isolate: true, transform_pattern_tiles: false, scale_corners: false, diff --git a/crates/engine/src/tests/prefs_file.rs b/crates/engine/src/tests/prefs_file.rs index bfe98b901b..98a756b1f7 100644 --- a/crates/engine/src/tests/prefs_file.rs +++ b/crates/engine/src/tests/prefs_file.rs @@ -197,3 +197,14 @@ fn hold_shortcut_preferences() { assert_eq!(restored.key_hold_delay(), 1.0); assert!(!restored.hold_shortcuts); } + +/// Display Print Size at 100% Zoom is on by default, also for saved preferences that predate the +/// key; a saved choice to turn it off stays off. +#[test] +fn display_print_size_is_on_unless_turned_off() { + assert!(Session::new().prefs.display_print_size); + let older: Prefs = serde_json::from_value(json!({"showToolTips": true})).unwrap(); + assert!(older.display_print_size); + let off: Prefs = serde_json::from_value(json!({"displayPrintSize": false})).unwrap(); + assert!(!off.display_print_size); +} diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 47358b5842..e8c9b13b50 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -333,6 +333,9 @@ impl VectorcraftApp { let now = now_secs(); self.perf.fps = self.frame_rate.frame(now, self.perf.frame_ms / 1000.0); self.sync_views(); + // A document that moved between the main window and a floating OS window, or opened, takes + // the density of the display that shows it. + self.settle_screen_ppi_if_changed(); self.refresh_replace_font_warning(false); updates_ui::tick(self, ctx); // Read the system clipboard only when that alone decides whether Paste is enabled. A diff --git a/crates/ui-egui/src/app/view.rs b/crates/ui-egui/src/app/view.rs index ae107769e6..383504b49c 100644 --- a/crates/ui-egui/src/app/view.rs +++ b/crates/ui-egui/src/app/view.rs @@ -22,8 +22,11 @@ impl VectorcraftApp { } self.views.truncate(docs.len()); self.views.extend(docs.iter().skip(self.views.len()).map(View::of)); + // A new view counts its zoom from the main window's display, where it is first shown. + let main = self.main_ppi(); for (view, doc) in self.views.iter_mut().zip(docs) { view.artboard = view.artboard.min(doc.doc.artboards.len().saturating_sub(1)); + view.shown_ppi.get_or_insert(main); } self.view_uids = docs.iter().map(|d| d.uid).collect(); panels::layers::retain_open_thumbs(&self.view_uids); @@ -105,33 +108,150 @@ impl VectorcraftApp { } /// The screen points an inch takes at 100% zoom with Display Print Size at 100% Zoom on, for - /// the display that shows the window; `None` with it off ([`crate::state::print_ppi`]). + /// the current window's display; `None` with it off ([`crate::state::print_ppi`]). pub(crate) fn print_ppi(&self) -> Option { - crate::state::print_ppi(self.session.prefs.display_print_size, self.services.screen_ppi) + self.print_ppi_of(crate::doc_windows::current(self)) } - /// Takes `ppi` as the measured density of the main window's display - /// ([`crate::Services::screen_ppi`]). With Display Print Size at 100% Zoom on, every document - /// window's view keeps its zoom percentage, so the art keeps its physical size on the new - /// display. Returns whether the density changed. + /// [`Self::print_ppi`] for window `w`: the density its view's zoom counts from, which is the + /// density of the display that shows it once [`Self::settle_screen_ppi`] has run. + pub(crate) fn print_ppi_of(&self, w: Option) -> Option { + let counted = w.and_then(|w| crate::doc_windows::view(self, w)?.shown_ppi); + let ppi = counted.unwrap_or_else(|| w.map_or(self.main_ppi(), |w| self.window_ppi(w))); + crate::state::print_ppi(self.session.prefs.display_print_size, ppi.ppi()) + } + + /// The density of the display that shows window `w`: its own OS window's when it floats in one + /// that the host found on a display, else the main window's ([`Self::main_ppi`]). + fn window_ppi(&self, w: crate::doc_windows::Win) -> crate::ScreenPpi { + crate::doc_windows::screen_ppi(self, w).unwrap_or(self.main_ppi()) + } + + /// The density the main window's views count from: the host's reading, or while the main + /// window's display has not answered, the last reading, so every view there counts from the + /// same density. + fn main_ppi(&self) -> crate::ScreenPpi { + match self.services.screen_ppi { + crate::ScreenPpi::Unread => self.canvas.windows.main_read.unwrap_or(crate::ScreenPpi::Unread), + read => read, + } + } + + /// Takes `ppi` as the density the host read for the main window's display, `None` for a + /// display that reports no size ([`crate::Services::screen_ppi`]), and settles the views + /// ([`Self::settle_screen_ppi`]). Returns whether the density changed. pub fn set_screen_ppi(&mut self, ppi: Option) -> bool { + self.set_screen_reading(crate::ScreenPpi::Read(ppi)) + } + + /// [`Self::set_screen_ppi`] with the host's reading, [`crate::ScreenPpi::Unread`] while the + /// main window's display is unknown or has not answered. + pub fn set_screen_reading(&mut self, ppi: crate::ScreenPpi) -> bool { if self.services.screen_ppi == ppi { return false; } - let before = self.print_ppi(); + // A switch of the preference made since the last frame applies before the reading does. + self.follow_print_size_switch(); self.services.screen_ppi = ppi; - if let (Some(before), Some(after)) = (before, self.print_ppi()) - && before != after - { - let k = after / before; - for v in &mut self.views { - v.zoom = (v.zoom * k).clamp(0.0313, 640.0); - } - self.canvas.windows.views.scale_zooms(k); + if ppi != crate::ScreenPpi::Unread && self.session.prefs.display_print_size { + self.canvas.windows.main_read = Some(ppi); } + self.settle_screen_ppi(); true } + /// Gives each window's view the density of the display that shows it. With Display Print Size + /// at 100% Zoom on, a view moved between two displays the host has read keeps its zoom + /// percentage (a display that reports no size counts 96 points to an inch), so the art keeps + /// its physical size on the new display; the views of other displays keep their zoom. At the + /// first reading of a view's display, a view that still has the zoom a fit or the document's + /// saved view gave it keeps that zoom, and any other view keeps its percentage, counted from + /// 96 points to an inch until then. + pub(crate) fn settle_screen_ppi(&mut self) { + for w in crate::doc_windows::windows(self) { + self.settle_window_ppi(w, true); + } + } + + /// [`Self::settle_screen_ppi`] for window `w` alone. With `keep` false (a fit made for the + /// window), the view counts from the display's reading, or from its first reading still to + /// come, without a change of zoom. + pub(crate) fn settle_window_ppi(&mut self, w: crate::doc_windows::Win, keep: bool) { + let on = self.session.prefs.display_print_size; + let now = self.window_ppi(w); + let reading = crate::doc_windows::screen_ppi(self, w).unwrap_or(self.services.screen_ppi); + let Some(v) = crate::doc_windows::view_mut(self, w) else { return }; + // Off, a view counts from no reading, so the first one after the preference is turned on + // keeps the zoom chosen meanwhile. + if !on { + v.shown_ppi = Some(crate::ScreenPpi::Unread); + return; + } + if !keep { + v.shown_ppi = Some(reading); + return; + } + // A display that has not answered yet leaves the view counting from the last one read, so + // the answer, when it comes, keeps the zoom percentage. + let crate::ScreenPpi::Read(after) = now else { + v.shown_ppi.get_or_insert(now); + return; + }; + let before = match v.shown_ppi { + Some(crate::ScreenPpi::Read(before)) => Some(before), + _ if v.fit_zoom == Some(v.zoom) => None, + _ => Some(None), + }; + if let Some(before) = before + && before != after + && let (Some(b), Some(a)) = (crate::state::print_ppi(on, before), crate::state::print_ppi(on, after)) + { + v.zoom = (v.zoom * a / b).clamp(0.0313, 640.0); + } + v.shown_ppi = Some(now); + } + + /// [`Self::settle_screen_ppi`] when the main window's density or a floating window's changed + /// since it last ran from here, or a window started or stopped floating, or Presentation Mode + /// started or ended. With Display Print Size at 100% Zoom off, the desktop host does not read + /// the displays: every density read before is forgotten, so the readings after the preference + /// is turned on again count as first readings. + pub(crate) fn settle_screen_ppi_if_changed(&mut self) { + self.follow_print_size_switch(); + let key = (self.services.screen_ppi, crate::doc_windows::floating_ppi(self)); + if self.canvas.windows.settled.as_ref() != Some(&key) { + self.settle_screen_ppi(); + self.canvas.windows.settled = Some(key); + } + } + + /// Takes in a change of Display Print Size at 100% Zoom since this last ran: turned off, every + /// density read before is forgotten; turned on, every view's zoom counts as the one its first + /// reading keeps. + fn follow_print_size_switch(&mut self) { + let off = !self.session.prefs.display_print_size; + let was_off = std::mem::replace(&mut self.canvas.windows.print_size_off, off); + if off && !was_off { + crate::doc_windows::forget_ppi(self); + self.services.screen_ppi = crate::ScreenPpi::Unread; + self.canvas.windows.main_read = None; + self.services.screens.clear(); + for w in crate::doc_windows::windows(self) { + if let Some(v) = crate::doc_windows::view_mut(self, w) { + v.shown_ppi = Some(crate::ScreenPpi::Unread); + } + } + } + if was_off && !off { + // The zoom chosen while it was off stays when the displays are read. + for w in crate::doc_windows::windows(self) { + if let Some(v) = crate::doc_windows::view_mut(self, w) { + v.fit_zoom = Some(v.zoom); + } + } + } + } + pub fn view_mut(&mut self) -> Option<&mut View> { self.sync_views(); let i = self.session.active_index()?; diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8b366665d4..f0a3402f38 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -51,8 +51,10 @@ use fill::fill_uncovered; #[cfg(test)] use fill::{fill_view, polygon_area}; #[cfg(test)] +use grid::PIXEL_GRID; +#[cfg(test)] use grid::ruler_rects; -use grid::{LineLook, PIXEL_GRID, PIXEL_GRID_ZOOM, checker, clip_segment, grid, ruler_input, rulers, rulers_hidden, textured_quad, view_bounds}; +use grid::{LineLook, PIXEL_GRID_ZOOM, checker, clip_segment, grid, pixel_grid, ruler_input, rulers, rulers_hidden, textured_quad, view_bounds}; pub(crate) use grid::{RulerScale, checker_texture, checker_tile, ruler_label, ruler_origin_dragging}; #[cfg(test)] pub(crate) use grid::{TRANSPARENCY_GRID, vertical_label_height}; @@ -410,12 +412,14 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { grid(&painter, &xf, doc.grid.spacing, doc.grid.subdivisions, look); } // The pixel grid (Guides & Grid › Show Pixel Grid (Above 600% Zoom)): in Pixel Preview from - // 600% zoom, a line at every document pixel over the art, so the pixels it rasterizes to show. + // 600% zoom as the zoom field counts it, a line at every document pixel over the art, so the + // pixels it rasterizes to show. let revolve_edit = app.ui.dialog.as_ref().is_some_and(crate::dialogs::revolve_gizmo::active); let view_info = app.view_info(); if !presenting { - if app.ui.view.pixel_preview && v.zoom >= PIXEL_GRID_ZOOM && app.session.prefs.show_pixel_grid { - grid(&painter, &xf, 1.0, 1, LineLook { color: PIXEL_GRID, dots: false }); + let shown = crate::state::zoom_display_percent(v.zoom, app.print_ppi()) / 100.0; + if app.ui.view.pixel_preview && shown >= PIXEL_GRID_ZOOM - 1e-9 && app.session.prefs.show_pixel_grid { + pixel_grid(&painter, &xf); } artboard_outlines(app, ui, &painter, &xf, &t); if app.ui.view.guides_shown() { diff --git a/crates/ui-egui/src/canvas/grid.rs b/crates/ui-egui/src/canvas/grid.rs index 97c68269fb..34107eb455 100644 --- a/crates/ui-egui/src/canvas/grid.rs +++ b/crates/ui-egui/src/canvas/grid.rs @@ -127,12 +127,23 @@ pub(super) fn clip_segment(a: Pos2, b: Pos2, r: egui::Rect) -> Option<(Pos2, Pos /// (left out when they would crowd). In the Dots style, a dot where gridlines cross the /// subdivisions instead. pub(super) fn grid(p: &egui::Painter, xf: &Xf, spacing: f64, subdiv: u32, look: LineLook) { + grid_lines(p, xf, spacing, subdiv, look, 4.0); +} + +/// The pixel grid (Guides & Grid › Show Pixel Grid (Above 600% Zoom)): a line at every document +/// pixel, however close the lines are; the caller shows it from 600%. +pub(super) fn pixel_grid(p: &egui::Painter, xf: &Xf) { + grid_lines(p, xf, 1.0, 1, LineLook { color: PIXEL_GRID, dots: false }, 0.0); +} + +/// [`grid`], left out when its lines would be less than `crowd` screen points apart. +fn grid_lines(p: &egui::Painter, xf: &Xf, spacing: f64, subdiv: u32, look: LineLook, crowd: f64) { // The painter clips to the canvas. let view = view_bounds(xf); let sub = spacing / subdiv.max(1) as f64; let step = if sub * xf.zoom >= 6.0 { sub } else { spacing }; // Dots crowd sooner than lines. - if step * xf.zoom < 4.0 || (look.dots && spacing * xf.zoom < 8.0) { + if step * xf.zoom < crowd || (look.dots && spacing * xf.zoom < 8.0) { return; } let major = |v: f64| (v / spacing - (v / spacing).round()).abs() < 1e-6; diff --git a/crates/ui-egui/src/canvas/panes.rs b/crates/ui-egui/src/canvas/panes.rs index 63d89f2be2..8f4361f04c 100644 --- a/crates/ui-egui/src/canvas/panes.rs +++ b/crates/ui-egui/src/canvas/panes.rs @@ -522,6 +522,7 @@ fn fit_pane(v: &mut View, doc: &vectorcraft_doc::Document, rect: egui::Rect, ui_ v.zoom = fit_zoom(rect, target, v.rotation, ui_zoom); v.center = target.center(); v.fitted = true; + v.fit_zoom = Some(v.zoom); } } @@ -545,8 +546,12 @@ fn draw_pane(app: &mut VectorcraftApp, ui: &Ui, w: Win, cell: egui::Rect) -> boo let Some(st) = app.session.documents().get(w.0) else { return false }; let doc = st.doc.clone(); let ui_zoom = ui.ctx().zoom_factor(); - if let Some(v) = crate::doc_windows::view_mut(app, w).filter(|v| !v.fitted) { - fit_pane(v, &doc, rect, ui_zoom); + if crate::doc_windows::view(app, w).is_some_and(|v| !v.fitted) { + // The fit is made for the display the pane is on (Display Print Size at 100% Zoom). + app.settle_window_ppi(w, false); + if let Some(v) = crate::doc_windows::view_mut(app, w) { + fit_pane(v, &doc, rect, ui_zoom); + } } let v = crate::doc_windows::view(app, w).copied().unwrap_or_default(); let Some(st) = app.session.documents().get(w.0) else { return false }; diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 3cbe57eefd..b72980e082 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -4822,6 +4822,8 @@ fn pixel_grid_shows_in_pixel_preview_from_600_percent() { (lines.len(), lines.first().is_some_and(|&i| i > image)) }; app.ui.view.pixel_preview = true; + // One document point per screen point at 100%, so 600% is a zoom of 6. + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); app.view_mut().unwrap().zoom = 8.0; let (n, over) = pixel_lines(&mut app); assert!(n >= 150, "a line every 8 px across the 800 × 600 canvas: {n}"); @@ -4830,6 +4832,20 @@ fn pixel_grid_shows_in_pixel_preview_from_600_percent() { assert_eq!(pixel_lines(&mut app).0, 0, "below 600%: none"); app.view_mut().unwrap().zoom = 6.0; assert!(pixel_lines(&mut app).0 >= 200, "from 600%"); + // With Display Print Size at 100% Zoom on, 600% counts from Actual Size, as the zoom field + // shows it: 96 points to an inch make a zoom of 6 show as 450%, and 8 as 600%. + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + assert_eq!(pixel_lines(&mut app).0, 0, "450%: none"); + app.view_mut().unwrap().zoom = 8.0; + assert!(pixel_lines(&mut app).0 >= 150, "600%"); + // At 2.5× UI Scaling the lines are 3.2 interface points apart, and still drawn. + ctx.set_zoom_factor(2.5); + pixel_lines(&mut app); + assert!(pixel_lines(&mut app).0 > 0, "600% at 2.5× UI Scaling"); + ctx.set_zoom_factor(1.0); + pixel_lines(&mut app); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); + app.view_mut().unwrap().zoom = 6.0; app.ui.view.pixel_preview = false; assert_eq!(pixel_lines(&mut app).0, 0, "out of Pixel Preview: none"); app.ui.view.pixel_preview = true; @@ -6035,7 +6051,7 @@ fn scrolls_and_pans_move_a_lowered_frame_by_whole_pixels() { /// another document, or when the device pixels a point changed. #[test] fn a_scrolls_leftover_pixel_part_carries_only_to_the_same_view() { - let view = View { zoom: 1.0, center: Point::new(100.0, 100.0), fitted: true, rotation: 0.0, artboard: 0, outline: false }; + let view = View { zoom: 1.0, center: Point::new(100.0, 100.0), fitted: true, ..View::default() }; let mut v = view; let rest = scroll_by(&mut v, 1, (1.0, 1.0), vec2(0.4, -0.3), ScrollRest::default()); assert_eq!(v.center, view.center, "less than half a pixel does not move the view"); @@ -8535,8 +8551,9 @@ fn a_rotation_with_fingers_on_a_touch_screen_turns_nothing() { assert_eq!(app.view().unwrap().rotation, before, "the view does not turn"); } -/// General › Display Print Size at 100% Zoom (#394): `view.actualSize` is one document point per -/// screen point with it off, and 96 screen points per document inch with it on. +/// General › Display Print Size at 100% Zoom (#394, #9051): on by default, `view.actualSize` shows +/// a document inch in 96 screen points where no display was measured; off, one document point +/// per screen point. #[test] fn view_actual_size_follows_display_print_size() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); @@ -8544,10 +8561,10 @@ fn view_actual_size_follows_display_print_size() { app.canvas_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0))); app.run("view.setZoom", json!({"zoom": 250})).unwrap(); app.run("view.actualSize", json!({})).unwrap(); - assert!((app.view().unwrap().zoom - 1.0).abs() < 1e-12, "off by default: 100% is 1:1"); - app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + assert!((app.view().unwrap().zoom - 96.0 / 72.0).abs() < 1e-12, "on by default: an inch is 96 screen points"); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); app.run("view.actualSize", json!({})).unwrap(); - assert!((app.view().unwrap().zoom - 96.0 / 72.0).abs() < 1e-12, "an inch is 96 screen points"); + assert!((app.view().unwrap().zoom - 1.0).abs() < 1e-12, "off, 100% is 1:1"); } /// #9051: with Display Print Size on, Actual Size shows a document inch in an inch of the display @@ -8561,7 +8578,10 @@ fn view_actual_size_fills_an_inch_of_the_measured_display() { let rect = egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0)); app.canvas_rect = Some(rect); app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.run("view.fitArtboard", json!({})).unwrap(); + let fitted = app.view().unwrap().zoom; assert!(app.set_screen_ppi(Some(127.0))); + assert_eq!(app.view().unwrap().zoom, fitted, "the first measurement leaves a fitted view alone"); let inch = |v: &View| { let xf = Xf::new(rect, v); f64::from(xf.to_screen(Point::new(72.0, 0.0)).x - xf.to_screen(Point::new(0.0, 0.0)).x) @@ -8577,12 +8597,56 @@ fn view_actual_size_fills_an_inch_of_the_measured_display() { assert!((inch(&first) - 91.0).abs() < 1e-3, "the other window's 100% still fills an inch"); assert_eq!(crate::state::zoom_label(first.zoom, app.print_ppi()), "100%"); assert_eq!(crate::state::zoom_label(app.view().unwrap().zoom, app.print_ppi()), "150%"); + assert!(app.set_screen_ppi(None), "the window moved to a display that reports no size"); + let first = *crate::doc_windows::view(&app, (0, 1)).unwrap(); + assert!((first.zoom * 72.0 - 96.0).abs() < 1e-9, "100% there is 96 points to an inch: {}", first.zoom * 72.0); + assert!(app.set_screen_ppi(Some(91.0)), "and back"); + let first = *crate::doc_windows::view(&app, (0, 1)).unwrap(); + assert!((first.zoom * 72.0 - 91.0).abs() < 1e-9, "100% fills an inch again: {}", first.zoom * 72.0); + assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "the window moved to a display that has not answered"); + app.session.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + app.run("view.actualSize", json!({})).unwrap(); + assert!((app.view().unwrap().zoom * 72.0 - 91.0).abs() < 1e-9, "a document opened meanwhile counts from the same density"); + assert!(app.set_screen_ppi(Some(127.0)), "and it answers"); + assert!((app.view().unwrap().zoom * 72.0 - 127.0).abs() < 1e-9, "both keep 100%"); + let first = *crate::doc_windows::view(&app, (0, 1)).unwrap(); + assert!((first.zoom * 72.0 - 127.0).abs() < 1e-9, "100% fills an inch there: {}", first.zoom * 72.0); app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); let zoom = app.view().unwrap().zoom; - assert!(app.set_screen_ppi(Some(127.0))); + assert!(app.set_screen_ppi(Some(110.0))); assert_eq!(app.view().unwrap().zoom, zoom, "off, a move leaves the zoom alone"); app.run("view.actualSize", json!({})).unwrap(); assert!((app.view().unwrap().zoom - 1.0).abs() < 1e-12, "and 100% stays one point per point"); + // Off, the densities read before are forgotten: the first reading after it is turned on again + // leaves the zoom chosen meanwhile alone. + app.settle_screen_ppi_if_changed(); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + assert!(app.set_screen_ppi(Some(91.0))); + assert!((app.view().unwrap().zoom - 1.0).abs() < 1e-12, "the first reading after turning it on keeps the zoom"); +} + +/// #9051: Actual Size chosen before the window's display is first read keeps 100% when the +/// reading arrives, and a fit made while the window's new display is being read stays the fit +/// when that reading arrives. +#[test] +fn actual_size_and_fits_made_before_a_reading_keep_their_meaning() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + app.canvas_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0))); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.run("view.actualSize", json!({})).unwrap(); + assert!((app.view().unwrap().zoom * 72.0 - 96.0).abs() < 1e-9, "unread, an inch is 96 points"); + assert!(app.set_screen_ppi(Some(127.0))); + assert!((app.view().unwrap().zoom * 72.0 - 127.0).abs() < 1e-9, "the reading keeps 100%: {}", app.view().unwrap().zoom * 72.0); + assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "the window moved to a display being read"); + app.run("view.fitArtboard", json!({})).unwrap(); + let fitted = app.view().unwrap().zoom; + assert!(app.set_screen_ppi(Some(190.0))); + assert_eq!(app.view().unwrap().zoom, fitted, "the fit was made for this display"); + assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "and to another display being read"); + app.run("view.actualSize", json!({})).unwrap(); + assert!(app.set_screen_ppi(Some(110.0))); + assert!((app.view().unwrap().zoom * 72.0 - 110.0).abs() < 1e-9, "Actual Size there is 100%: {}", app.view().unwrap().zoom * 72.0); } /// Fit Artboard in Window fits the artboard as a rotated view shows it: at 45° every corner is @@ -8639,7 +8703,7 @@ fn animated_zoom_scrubs_and_holds_else_the_zoom_tool_zooms_to_an_area() { press(&mut app, vec2(-100.0, 0.0), 0); assert!((app.view().unwrap().zoom - z0).abs() < 1e-6, "and back to the left"); press(&mut app, vec2(0.0, 0.0), 0); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z0, true, None), "a click steps"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z0, true, app.print_ppi()), "a click steps"); let z2 = app.view().unwrap().zoom; press(&mut app, vec2(0.0, 0.0), 40); assert!(app.view().unwrap().zoom > z2 * 1.2, "held, it zooms on"); @@ -8994,9 +9058,9 @@ fn cmd_space_zooms_and_space_pans_whatever_the_tool() { let z0 = app.view().unwrap().zoom; drag(&mut app, Modifiers::COMMAND, at); let z1 = app.view().unwrap().zoom; - assert_eq!(z1, crate::state::next_zoom(z0, true, None), "Cmd+Space click zooms in"); + assert_eq!(z1, crate::state::next_zoom(z0, true, app.print_ppi()), "Cmd+Space click zooms in"); drag(&mut app, Modifiers::COMMAND | Modifiers::ALT, at); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z1, false, None), "Cmd+Alt+Space click zooms out"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(z1, false, app.print_ppi()), "Cmd+Alt+Space click zooms out"); assert_eq!(app.session.active().unwrap().doc.art_bounds(), None, "the Rectangle tool drew nothing"); // Space alone pans, with the Zoom tool too. app.select_tool("zoom"); @@ -9044,7 +9108,7 @@ fn space_types_a_space_while_editing_text_and_does_not_pan() { assert_eq!(shown(&mut app), CursorIcon::ZoomIn, "Cmd+Space shows the magnifier"); typing_frame(&mut app, &ctx, vec![button(at, true, Modifiers::COMMAND)]); typing_frame(&mut app, &ctx, vec![button(at, false, Modifiers::COMMAND)]); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(before.zoom, true, None), "Cmd+Space click zooms in"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(before.zoom, true, app.print_ppi()), "Cmd+Space click zooms in"); typing_frame(&mut app, &ctx, vec![space(false, Modifiers::COMMAND), Event::ModifiersChanged(Modifiers::NONE)]); assert_eq!(plain(&app, id), "a ", "the text is as typed"); } @@ -9154,7 +9218,7 @@ fn space_shift_drag_rotates_the_view_whatever_the_tool() { assert_eq!((panned.rotation, panned.zoom), (v.rotation, v.zoom)); assert_ne!(panned.center, v.center, "Space pans"); drag(&mut app, Modifiers::COMMAND | Modifiers::SHIFT, true, c, c); - assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(v.zoom, true, None), "Cmd+Shift+Space click zooms in"); + assert_eq!(app.view().unwrap().zoom, crate::state::next_zoom(v.zoom, true, app.print_ppi()), "Cmd+Shift+Space click zooms in"); assert_eq!(app.view().unwrap().rotation, v.rotation); // The Rotate View tool's Shift still rounds to 15°. app.select_tool("rotateView"); diff --git a/crates/ui-egui/src/canvas/tests_ui_scaling.rs b/crates/ui-egui/src/canvas/tests_ui_scaling.rs index 335f332529..1874fef69b 100644 --- a/crates/ui-egui/src/canvas/tests_ui_scaling.rs +++ b/crates/ui-egui/src/canvas/tests_ui_scaling.rs @@ -25,11 +25,13 @@ fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, (native, ui_zoom): (f32, } /// A 512 × 512 pt document shown at `native` device pixels a point and UI Scaling `ui_zoom`, with a -/// controlled render worker, and the receiver of the frames it is asked to render. +/// controlled render worker, and the receiver of the frames it is asked to render. Display Print +/// Size at 100% Zoom is off, so 100% is one document point per screen point. fn shown(native: f32, ui_zoom: f32) -> (VectorcraftApp, egui::Context, std::sync::mpsc::Receiver) { let ctx = egui::Context::default(); crate::theme::install_fonts(&ctx); let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); app.run("file.new", json!({"width": 512, "height": 512})).unwrap(); app.canvas.worker_started = true; let (worker, jobs, _done) = crate::render_worker::Worker::test_channel(); diff --git a/crates/ui-egui/src/canvas/view.rs b/crates/ui-egui/src/canvas/view.rs index 825db3940d..b2714f2645 100644 --- a/crates/ui-egui/src/canvas/view.rs +++ b/crates/ui-egui/src/canvas/view.rs @@ -30,6 +30,12 @@ pub fn fit(app: &mut VectorcraftApp, how: &str) { _ => st.doc.artboards.get(current).or(st.doc.artboards.first()).map(|a| a.rect), }; let Some(target) = target else { return }; + // A fit to the window is made for the display the window is on now; Actual Size counts from + // the density the view counts from, which a reading still to come rescales (Display Print + // Size at 100% Zoom). + if let Some(w) = crate::doc_windows::current(app) { + app.settle_window_ppi(w, how == "view.actualSize"); + } let zoom = if how == "view.actualSize" { actual_size_zoom(app.print_ppi()) } else { @@ -39,6 +45,8 @@ pub fn fit(app: &mut VectorcraftApp, how: &str) { v.center = target.center(); v.fitted = true; v.zoom = zoom; + // Actual Size is a percentage; the other fits are made for the window. + v.fit_zoom = (how != "view.actualSize").then_some(zoom); } /// The zoom at which `target`, turned `rotation` degrees with the view, fits in `rect` (points of diff --git a/crates/ui-egui/src/chrome/status_bar.rs b/crates/ui-egui/src/chrome/status_bar.rs index 8149c3cb5a..693fcac30d 100644 --- a/crates/ui-egui/src/chrome/status_bar.rs +++ b/crates/ui-egui/src/chrome/status_bar.rs @@ -17,7 +17,9 @@ pub fn status_bar(app: &mut VectorcraftApp, ui: &mut Ui) { .selected_text(egui::RichText::new(zoom_label(zoom, print)).size(11.5)) .width(76.0) .show_ui(ui, |ui| { - for z in ZOOM_STOPS.iter().rev() { + // The stops the zoom range reaches, which counts from Actual Size. + let (lo, hi) = (crate::state::zoom_display_percent(0.0313, print), crate::state::zoom_display_percent(640.0, print)); + for z in ZOOM_STOPS.iter().rev().filter(|z| (lo - 1e-6..=hi + 1e-6).contains(*z)) { if ui .selectable_label((z - shown).abs() < 0.01, zoom_label(crate::state::zoom_from_display_percent(*z, print), print)) .clicked() diff --git a/crates/ui-egui/src/chrome/tabs.rs b/crates/ui-egui/src/chrome/tabs.rs index e27877ca11..d90183551e 100644 --- a/crates/ui-egui/src/chrome/tabs.rs +++ b/crates/ui-egui/src/chrome/tabs.rs @@ -31,7 +31,7 @@ fn view_tab_name(d: &vectorcraft_engine::DocState, number: Option) -> Strin fn window_tab_title(app: &VectorcraftApp, w: crate::doc_windows::Win, d: &vectorcraft_engine::DocState) -> String { let view = crate::doc_windows::view(app, w); let zoom = view.map_or(1.0, |v| v.zoom); - view_tab_title(d, crate::doc_windows::label(app, w), zoom, view.is_some_and(|v| v.outline), app.print_ppi()) + view_tab_title(d, crate::doc_windows::label(app, w), zoom, view.is_some_and(|v| v.outline), app.print_ppi_of(Some(w))) } /// The title of window `w`'s tab and floating window ([`crate::doc_windows`]). diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index d5a5743744..273cc3484f 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -1473,7 +1473,7 @@ fn the_artboard_navigator_goes_to_artboards_and_fitting_shows_the_current_one() app.run("view.fitArtboard", json!({})).unwrap(); assert_eq!(at(&app), (1, Point::new(320.0, 50.0))); app.run("view.actualSize", json!({})).unwrap(); - assert_eq!((at(&app).1, app.view().unwrap().zoom), (Point::new(320.0, 50.0), 1.0)); + assert_eq!((at(&app).1, app.view().unwrap().zoom), (Point::new(320.0, 50.0), crate::state::zoom_baseline(app.print_ppi()))); click(&mut app, buttons[0]); assert_eq!(at(&app), (0, Point::new(100.0, 50.0)), "first"); // The command also takes an index, clamped to the last artboard. diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 218312750d..5b0475a168 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -280,6 +280,12 @@ pub fn inspect(app: &VectorcraftApp, ctx: &egui::Context) -> Value { // The display profile the canvas is drawn through, or why none (Preferences › // Performance › Use Monitor Profile for Canvas). "displayProfile": app.display_profile.status(app.session.prefs.monitor_profile_display), + // With Preferences › General › Display Print Size at 100% Zoom on, the measured density of + // the main window's display in points per inch (null where none was measured), and the + // points an inch takes at 100% in the current window. Both are null with it off, when the + // desktop app does not measure the displays. + "screenPpi": app.session.prefs.display_print_size.then(|| app.services.screen_ppi.ppi()).flatten(), + "printPpi": app.print_ppi(), // Window › Arrange › Tile and its layout (not saved, so not in `ui`) and the panes the // last frame drew: each one's document index, view number (Window › New Window) and rect. // Canvas coordinates map to the current window's pane, inside its rulers and scroll bars diff --git a/crates/ui-egui/src/control/tests.rs b/crates/ui-egui/src/control/tests.rs index 96ffd47261..c7655913f4 100644 --- a/crates/ui-egui/src/control/tests.rs +++ b/crates/ui-egui/src/control/tests.rs @@ -2,7 +2,7 @@ use serde_json::{Value, json}; use vectorcraft_engine::Session; use vectorcraft_tools::{Mods, PointerEvent, PointerKind}; -use super::{ControlRequest, MAX_DIALOG_FIELDS, Outcome, handle}; +use super::{ControlRequest, MAX_DIALOG_FIELDS, Outcome, handle, inspect}; use crate::state::Dialog; use crate::{Services, VectorcraftApp}; @@ -977,6 +977,23 @@ fn ui_commands_refuse_params_of_the_wrong_type() { assert_eq!(app.view().map(|v| v.zoom), Some(crate::state::zoom_from_display_percent(100.0, app.print_ppi()))); } +/// `ui.inspect` gives the measured density of the main window's display and the points an inch +/// takes at 100% while Display Print Size at 100% Zoom is on, and neither with it off (#9051). +#[test] +fn inspect_reports_the_display_density() { + let mut app = VectorcraftApp::new(Session::new(), Services::default()); + app.run("file.new", json!({"width": 400, "height": 400})).unwrap(); + let ctx = egui::Context::default(); + let got = inspect(&app, &ctx); + assert_eq!((got["screenPpi"].clone(), got["printPpi"].as_f64()), (Value::Null, Some(96.0)), "nothing measured: an inch is 96 points"); + app.set_screen_ppi(Some(127.0)); + let got = inspect(&app, &ctx); + assert_eq!((got["screenPpi"].as_f64(), got["printPpi"].as_f64()), (Some(127.0), Some(127.0))); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); + let got = inspect(&app, &ctx); + assert_eq!((got["screenPpi"].clone(), got["printPpi"].clone()), (Value::Null, Value::Null)); +} + #[test] fn synthetic_pointer_backquote_keeps_solid_object_in_place() { let mut app = VectorcraftApp::new(Session::new(), Services::default()); diff --git a/crates/ui-egui/src/doc_windows.rs b/crates/ui-egui/src/doc_windows.rs index ba324558d3..f565fcb4a8 100644 --- a/crates/ui-egui/src/doc_windows.rs +++ b/crates/ui-egui/src/doc_windows.rs @@ -68,6 +68,14 @@ pub struct DocWindow { /// While its OS window's tab is dragged: where the pointer is from the window's top-left /// corner, on the screen. grab: Option, + /// The density of the display that shows its OS window ([`crate::services::screen_ppi_at`]), + /// while the window is on a display the host listed; `None` before that, while it is on none + /// of them, and inside the main window, where the window counts the main window's density. + ppi: Option, + /// The last frame drew it as an OS window of its own. + os: bool, + /// A display that shows its OS window has been read since it opened. + was_read: bool, } /// [`DocWindow::fit`]: a body size, and a view's zoom and center. @@ -75,7 +83,61 @@ type Fit = (egui::Vec2, f64, vectorcraft_geom::Point); impl DocWindow { fn new((uid, view): (u64, u32), place: egui::Rect) -> Self { - Self { uid, view, place, number: 0, generation: 0, screen: None, focused: false, body: None, fit: None, grab: None } + Self { + uid, + view, + place, + number: 0, + generation: 0, + screen: None, + focused: false, + body: None, + fit: None, + grab: None, + ppi: None, + os: false, + was_read: false, + } + } +} + +/// The density of the display that shows floating window `x`'s OS window: read once the window +/// was found on a display, unread until then; `None` for a window inside the main window, which +/// counts the main window's density, and for the window Presentation Mode shows there. +fn window_ppi(app: &VectorcraftApp, x: &DocWindow) -> Option { + if presenting(app) && current(app).and_then(|w| key(app, w)) == Some((x.uid, x.view)) { + return None; + } + x.ppi.or(x.os.then_some(crate::ScreenPpi::Unread)) +} + +/// [`window_ppi`] for window `w`; `None` for a window that does not float. +pub(crate) fn screen_ppi(app: &VectorcraftApp, w: Win) -> Option { + let (u, n) = key(app, w)?; + window_ppi(app, app.ui.floating.iter().find(|x| x.uid == u && x.view == n)?) +} + +/// A floating window ([`views::key`]) with the density of the display that shows it +/// ([`window_ppi`]). +pub(crate) type FloatingPpi = ((u64, u32), Option); + +/// Each floating window with the density of the display that shows it. +pub(crate) fn floating_ppi(app: &VectorcraftApp) -> Vec { + app.ui.floating.iter().map(|x| ((x.uid, x.view), window_ppi(app, x))).collect() +} + +/// Forgets the densities found for the floating windows' displays. +pub(crate) fn forget_ppi(app: &mut VectorcraftApp) { + for x in &mut app.ui.floating { + x.ppi = None; + } +} + +/// Sets the density of the display that shows floating window `key`'s ([`views::key`]) OS window. +#[cfg(test)] +pub(crate) fn set_window_ppi(app: &mut VectorcraftApp, (uid, view): (u64, u32), ppi: Option) { + if let Some(x) = app.ui.floating.iter_mut().find(|x| x.uid == uid && x.view == view) { + x.ppi = Some(crate::ScreenPpi::Read(ppi)); } } @@ -101,6 +163,14 @@ pub struct Windows { /// in ([`crate::canvas::note_drop`]): each window's view ([`views::key`]), the part of its pane /// inside its rulers and scroll bars in the main window's points, and the layer it drew in. pub(crate) drops: Vec<((u64, u32), egui::Rect, egui::LayerId)>, + /// The main window's density and the floating windows' ([`floating_ppi`]) when the views were + /// last settled each frame ([`VectorcraftApp::settle_screen_ppi_if_changed`]). + pub(crate) settled: Option<(crate::ScreenPpi, Vec)>, + /// Display Print Size at 100% Zoom was off when the views were last settled each frame. + pub(crate) print_size_off: bool, + /// The last density the host read for the main window's display; the main window's views + /// count from it while its display has not answered. + pub(crate) main_read: Option, } impl Windows { @@ -382,6 +452,8 @@ struct Shown { body: Option, /// [`DocWindow::fit`] after this frame. fit: Option, + /// The density of the display that shows its OS window, when it was found on one. + ppi: Option, } /// Draw the floating document windows, after the main window's canvas. Call once per frame from @@ -452,7 +524,8 @@ pub(crate) fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { for w in app.ui.floating.clone() { let Some(win) = find(app, (w.uid, w.view)) else { continue }; let raised = raise == Some((w.uid, w.view)); - let shown = if native { os_window(app, ctx, &w, (win, blocked), raised) } else { app_window(app, ctx, &w, (win, blocked), raised) }; + let mut shown = if native { os_window(app, ctx, &w, (win, blocked), raised) } else { app_window(app, ctx, &w, (win, blocked), raised) }; + take_window_ppi(app, ctx, ((w.uid, w.view), native), win, &mut shown); if blocked { continue; } @@ -540,6 +613,46 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, (win, blocked): (Win, bool) (pressed, rect, fit) } +/// Takes the density of the display that `shown`, floating window `key`'s ([`views::key`]) window +/// `win`, was found on, and whether it is an OS window of its own (`os`), and settles the views +/// when the density changed ([`VectorcraftApp::settle_window_ppi`]). A view that still has the +/// zoom its window fitted it to at the window's present size keeps that zoom, and keeps fitting +/// the window. +fn take_window_ppi(app: &mut VectorcraftApp, ctx: &egui::Context, ((uid, number), os): ((u64, u32), bool), win: Win, shown: &mut Shown) { + let Some(x) = app.ui.floating.iter_mut().find(|x| x.uid == uid && x.view == number) else { return }; + x.os = os; + // Drawn inside the main window, it counts the main window's density. + if !os { + shown.ppi = None; + if x.ppi.take().is_some() { + app.settle_window_ppi(win, true); + } + return; + } + // Off every display the host listed (moved past their edges, or its display went), it is + // unread: its view counts from the density it was shown at until a display is found again. + if shown.ppi.is_none() { + if x.ppi.take().is_some() { + app.settle_window_ppi(win, true); + ctx.request_repaint(); + } + return; + } + if x.ppi == shown.ppi { + return; + } + // Its first reading, or a fit made this frame, is a baseline; a move from a display read + // before keeps the zoom percentage. + let first = !x.was_read; + let fitted_now = shown.fit.is_some() && shown.fit != x.fit; + x.ppi = shown.ppi; + x.was_read |= matches!(shown.ppi, Some(crate::ScreenPpi::Read(_))); + let size = shown.body.map(|b| b.size()); + let following = view(app, win).is_some_and(|v| v.fitted && shown.fit.is_some_and(|(s, z, c)| Some(s) == size && z == v.zoom && c == v.center)); + app.settle_window_ppi(win, !(following && (first || fitted_now))); + ctx.request_repaint(); +} + /// Window `win`'s floating window `w` as an OS window of its own, `blocked` by a modal or not; /// `raise` brings it to the front. Its tab is at the top of the window, above its body. fn os_window(app: &mut VectorcraftApp, ctx: &egui::Context, w: &DocWindow, (win, blocked): (Win, bool), raise: bool) -> Shown { @@ -595,7 +708,8 @@ fn os_window(app: &mut VectorcraftApp, ctx: &egui::Context, w: &DocWindow, (win, (events, Some(inp.modifiers)) }); } - Shown { close, activate, over_strip, dock, focused, body: Some(rect), fit } + let ppi = crate::services::screen_ppi_at(&app.services.screens, ui.ctx()); + Shown { close, activate, over_strip, dock, focused, body: Some(rect), fit, ppi } }); if !forwarded.0.is_empty() { crate::panel_docking::forward_keys(app, ctx, forwarded.0, forwarded.1); @@ -676,7 +790,7 @@ fn app_window(app: &mut VectorcraftApp, ctx: &egui::Context, w: &DocWindow, (win let moved = mover.map_or((false, false), |r| (r.dragged(), r.drag_stopped())); let pointer = ctx.input(|inp| inp.pointer.latest_pos()); let over_strip = !blocked && (moved.0 || moved.1) && app.canvas.windows.strip.zip(pointer).is_some_and(|(strip, p)| strip.contains(p)); - Shown { close: !open, activate, over_strip, dock: over_strip && moved.1, focused: false, body: rect, fit } + Shown { close: !open, activate, over_strip, dock: over_strip && moved.1, focused: false, body: rect, fit, ppi: None } } /// The host's rewrites of raw input ([`crate::services::Services::native_input_hook`]) for the diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index 7fede442da..d4f280267b 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -1226,3 +1226,71 @@ fn an_os_windows_pane_is_not_a_place_to_release_art_in_the_main_windows_points() app_frame(&mut app, &ctx, vec![]); assert!(app.canvas.windows.drops.is_empty(), "nor is the main window's pane while an OS window holds the canvas"); } + +/// #9051: an OS window's display is the one at the window's scale factor that covers most of it. A +/// 1× display to the right of a 2× one on macOS starts, in pixels, inside the 2× display's pixels. +#[test] +fn an_os_window_finds_the_display_at_its_own_scale() { + use crate::ScreenPpi::Read; + use crate::services::{ScreenDensity, screen_ppi_at}; + let screens = [ + ScreenDensity { rect: [0, 0, 3024, 1964], scale: 2.0, ppi: Read(Some(127.0)) }, + ScreenDensity { rect: [1512, 0, 1920, 1080], scale: 1.0, ppi: Read(Some(92.0)) }, + ]; + let at = |center: Pos2, native: f32| { + let ctx = egui::Context::default(); + let mut input = egui::RawInput::default(); + let info = input.viewports.entry(egui::ViewportId::ROOT).or_default(); + info.native_pixels_per_point = Some(native); + info.outer_rect = Some(egui::Rect::from_center_size(center, vec2(200.0, 100.0))); + let mut found = None; + let mut out = ctx.run_ui(input, |ui| found = screen_ppi_at(&screens, ui.ctx())); + out.textures_delta.clear(); + found + }; + assert_eq!(at(pos2(1800.0, 300.0), 1.0), Some(Read(Some(92.0))), "on the 1× display"); + assert_eq!(at(pos2(700.0, 300.0), 2.0), Some(Read(Some(127.0))), "on the 2× display"); + assert_eq!(at(pos2(2000.0, 1100.0), 1.0), Some(Read(Some(92.0))), "partly below the 1× display, its center off it"); + assert_eq!(at(pos2(9000.0, 300.0), 1.0), None, "off every display"); +} + +/// #9051: with Display Print Size at 100% Zoom on, a document floating in an OS window of its own +/// counts 100% from the display that shows that window. A move of its window to a display of +/// another density keeps its zoom percentage; a move of the main window leaves its zoom alone and +/// keeps the percentage of the documents under the tabs. +#[test] +fn a_floating_window_counts_100_percent_from_its_own_display() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("view.actualSize", json!({})).unwrap(); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let pct = |app: &VectorcraftApp, i: usize| crate::state::zoom_display_percent(app.views[i].zoom, app.print_ppi_of(Some((i, 1)))); + let uid = app.session.documents()[1].uid; + set_window_ppi(&mut app, (uid, 1), Some(91.0)); + app.settle_screen_ppi(); + assert!((pct(&app, 1) - 100.0).abs() < 1e-9, "the floating document stays at 100%: {}", pct(&app, 1)); + assert!((app.views[1].zoom * 72.0 - 91.0).abs() < 1e-9, "an inch of the document fills an inch of its display"); + let (floating, tabbed, tabbed_pct) = (app.views[1].zoom, app.views[0].zoom, pct(&app, 0)); + assert!(app.set_screen_ppi(Some(150.0)), "the main window moved to a denser display"); + assert_eq!(app.views[1].zoom, floating, "the floating window did not move"); + assert!(app.views[0].zoom > tabbed, "the tabbed document zooms with the denser display"); + assert!((pct(&app, 0) - tabbed_pct).abs() < 1e-9, "and keeps its percentage"); + // Presentation Mode shows the floating document in the main window, on the main window's + // display, and it keeps its 100% there. + app.settle_screen_ppi_if_changed(); + app.ui.screen_mode = 3; + app.settle_screen_ppi_if_changed(); + assert!((app.views[1].zoom * 72.0 - 150.0).abs() < 1e-9, "presented on the main window's display: {}", app.views[1].zoom * 72.0); + assert!((pct(&app, 1) - 100.0).abs() < 1e-9); + // Back from its own display under the tabs, a fit made there is kept. + app.ui.screen_mode = 0; + app.settle_screen_ppi_if_changed(); + app.run("window.arrange.consolidateAllWindows", json!({})).unwrap(); + app.run("view.fitArtboard", json!({})).unwrap(); + let fitted = app.views[1].zoom; + app.settle_screen_ppi_if_changed(); + assert_eq!(app.views[1].zoom, fitted, "the fit is made for the main window's display"); +} diff --git a/crates/ui-egui/src/doc_windows/views.rs b/crates/ui-egui/src/doc_windows/views.rs index 885e91fbee..dda76952ee 100644 --- a/crates/ui-egui/src/doc_windows/views.rs +++ b/crates/ui-egui/src/doc_windows/views.rs @@ -36,15 +36,6 @@ pub struct Views { shown: HashMap, } -impl Views { - /// Multiplies the zoom of every view kept here by `k`, within the zoom range. - pub(crate) fn scale_zooms(&mut self, k: f64) { - for o in &mut self.others { - o.view.zoom = (o.view.zoom * k).clamp(0.0313, 640.0); - } - } -} - fn uid(app: &VectorcraftApp, i: usize) -> Option { app.session.documents().get(i).map(|d| d.uid) } diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 167737554d..a547a5de48 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3209,7 +3209,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. „Селекция › Същото › Цвят на запълване“, „Цвят на щриха“ и „Запълване и щрих“ намират само същия нюанс на глобална или плътна мостра, а не всеки неин нюанс. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показва началния екран, когато няма отворен документ; ако е изключено, прозорецът остава празен, докато не щракнете „Начало“. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Измерва обектите заедно с щрихите и ефектите, които променят формата, за размер, позиция и подравняване; сенките, сиянията и замъгляванията не се измерват. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. При мащаб 100 % един инч от документа заема 96 екранни точки вместо 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. При мащаб 100 % един инч от документа запълва един инч от дисплея или 96 екранни точки, когато системата не съобщава размера на дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Двойно щракване върху група, контур или изображение с инструмента „Селекция“ ги отваря в режим на изолация. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Запълванията и щрихите с мостра се трансформират заедно с графиката, освен ако трансформацията или менюто на панела „Трансформиране“ не избере друго. Live corner radii scale with the art, unless the scale chooses otherwise. Радиусите на динамичните ъгли се мащабират заедно с графиката, освен ако мащабирането не избере друго. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a9d6e35ed8..9204190552 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4696,7 +4696,7 @@ font-technology Variable Varijabilni Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Odabir › Isto › Boja ispune, Boja poteza i Ispuna i potez pronalaze samo istu nijansu globalnog ili spot uzorka, a ne bilo koju njegovu nijansu. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Prikazuje početni ekran kada nijedan dokument nije otvoren; kada je isključeno, prozor ostaje prazan dok ne kliknete Početna. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mjeri objekte zajedno s potezima i efektima koji mijenjaju oblik za veličinu, položaj i poravnanje; sjene, sjaj i zamućenja se ne mjere. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Pri zumu od 100% jedan inč dokumenta zauzima 96 tačaka ekrana umjesto 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Pri zumu od 100% jedan inč dokumenta ispunjava jedan inč ekrana, ili 96 tačaka ekrana kada sistem ne javlja veličinu ekrana. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dvostruki klik na grupu, putanju ili sliku alatom Odabir otvara ih u načinu izolacije. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Ispune i potezi s uzorkom transformišu se zajedno s grafikom, osim ako transformacija ili meni panela Transformiši ne odabere drugačije. Live corner radii scale with the art, unless the scale chooses otherwise. Poluprečnici dinamičnih uglova skaliraju se zajedno s grafikom, osim ako skaliranje ne odabere drugačije. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e4271f7926..d9fe0a739a 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4067,7 +4067,7 @@ digits Malayalam Malaiàlam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selecció › Igual › Color de farciment, Color del traç i Farciment i traç només coincideixen amb el mateix matís d’una mostra global o de tinta plana, no amb qualsevol matís seu. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra la pantalla d’inici quan no hi ha cap document obert; desactivada, la finestra queda buida fins que feu clic a Inici. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mesura els objectes amb els traços i els efectes que en canvien la forma per a la mida, la posició i l’alineació; les ombres, les lluïsors i els desenfocaments no es mesuren. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Amb un zoom del 100 %, una polzada del document ocupa 96 punts de pantalla en lloc de 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Amb un zoom del 100 %, una polzada del document omple una polzada de la pantalla, o 96 punts de pantalla quan el sistema no n’indica la mida. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Fer doble clic en un grup, traçat o imatge amb l’eina Selecció l’obre en mode d’aïllament. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Els farciments i traços de motiu es transformen amb la il·lustració, tret que una transformació o el menú del panell Transforma triï una altra cosa. Live corner radii scale with the art, unless the scale chooses otherwise. Els radis de cantonada dinàmics s’escalen amb la il·lustració, tret que l’escalat triï una altra cosa. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 488df173c3..bb1e2f34ab 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4805,7 +4805,7 @@ font-technology Variable Variabilní Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Výběr › Stejné › Barva výplně, Barva tahu a Výplň a tah najdou jen stejný odstín globálního nebo přímého vzorku, ne libovolný jeho odstín. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Zobrazí domovskou obrazovku, když není otevřený žádný dokument; když je vypnuto, okno zůstane prázdné, dokud neklepnete na Domů. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Měří objekty včetně tahů a efektů měnících tvar pro velikost, polohu a zarovnání; stíny, záře a rozostření se neměří. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Při zvětšení 100 % zabere jeden palec dokumentu 96 obrazovkových bodů místo 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Při zvětšení 100 % vyplní jeden palec dokumentu jeden palec displeje, nebo 96 obrazovkových bodů, pokud systém velikost displeje neudává. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Poklepání na skupinu, cestu nebo obraz nástrojem Výběr je otevře v izolačním režimu. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Výplně a tahy se vzorkem se transformují s kresbou, pokud transformace nebo nabídka panelu Transformace nezvolí jinak. Live corner radii scale with the art, unless the scale chooses otherwise. Poloměry živých rohů se mění s velikostí kresby, pokud změna velikosti nezvolí jinak. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 302ab6aa69..d3978bfddf 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7253,7 +7253,7 @@ font-technology Variable Variable Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Markér › Samme › Fyldfarve, Stregfarve og Fyld og streg finder kun samme nuance af en global farveprøve eller staffagefarve, ikke en hvilken som helst nuance af den. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Viser startskærmen, når intet dokument er åbent; når den er slået fra, forbliver vinduet tomt, indtil du klikker på Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Måler objekter med deres streger og formændrende effekter til størrelse, position og justering; skygger, glød og sløringer måles ikke. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Ved 100 % zoom fylder en tomme af dokumentet 96 skærmpunkter i stedet for 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Ved 100 % zoom fylder en tomme af dokumentet en tomme af skærmen, eller 96 skærmpunkter, hvis systemet ikke oplyser skærmens størrelse. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dobbeltklik på en gruppe, en sti eller et billede med værktøjet Markering åbner det i isolationstilstand. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Mønsterfyld og -streger transformeres med grafikken, medmindre en transformation eller menuen i panelet Transformér vælger andet. Live corner radii scale with the art, unless the scale chooses otherwise. Live-hjørneradier skaleres med grafikken, medmindre skaleringen vælger andet. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 9482345f18..2663967128 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3279,7 +3279,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. „Auswahl › Gleich › Flächenfarbe“, „Konturfarbe“ und „Fläche und Kontur“ finden nur denselben Farbton eines globalen oder Volltonfarbfelds, nicht jeden Farbton davon. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Zeigt den Startbildschirm, wenn kein Dokument geöffnet ist; ist die Option aus, bleibt das Fenster leer, bis Sie auf „Start“ klicken. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Misst Objekte für Größe, Position und Ausrichtung mit ihren Konturen und formverändernden Effekten; Schatten, Schein und Weichzeichnungen werden nicht gemessen. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Bei 100 % Zoom nimmt ein Zoll des Dokuments 96 statt 72 Bildschirmpunkte ein. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Bei 100 % Zoom füllt ein Zoll des Dokuments einen Zoll des Bildschirms, oder 96 Bildschirmpunkte, wenn das System keine Bildschirmgröße meldet. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ein Doppelklick mit dem Auswahl-Werkzeug auf eine Gruppe, einen Pfad oder ein Bild öffnet sie im Isolationsmodus. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Musterflächen und -konturen werden mit dem Bildmaterial transformiert, sofern die Transformation oder das Menü des Bedienfelds „Transformieren“ nichts anderes wählt. Live corner radii scale with the art, unless the scale chooses otherwise. Live-Eckenradien skalieren mit dem Bildmaterial, sofern die Skalierung nichts anderes wählt. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 434d0cc0b8..579174fce7 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4132,7 +4132,7 @@ digits Malayalam Μαλαγιάλαμ Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Τα Επιλογή › Ίδιο › Χρώμα γεμίσματος, Χρώμα περιγράμματος και Γέμισμα και περίγραμμα βρίσκουν μόνο την ίδια απόχρωση ενός καθολικού ή σημειακού δείγματος, όχι οποιαδήποτε απόχρωσή του. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Εμφανίζει την αρχική οθόνη όταν δεν είναι ανοιχτό κανένα έγγραφο· όταν είναι ανενεργό, το παράθυρο μένει κενό μέχρι να κάνετε κλικ στην Αρχική οθόνη. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Μετρά τα αντικείμενα μαζί με τα περιγράμματα και τα εφέ που αλλάζουν το σχήμα τους για μέγεθος, θέση και στοίχιση· οι σκιές, οι λάμψεις και οι θολώσεις δεν μετρώνται. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Σε ζουμ 100%, μία ίντσα του εγγράφου καταλαμβάνει 96 στιγμές οθόνης αντί για 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Σε ζουμ 100%, μία ίντσα του εγγράφου γεμίζει μία ίντσα της οθόνης, ή 96 στιγμές οθόνης όταν το σύστημα δεν αναφέρει το μέγεθος της οθόνης. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Το διπλό κλικ σε ομάδα, διαδρομή ή εικόνα με το εργαλείο Επιλογή την ανοίγει σε λειτουργία απομόνωσης. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Τα γεμίσματα και τα περιγράμματα μοτίβου μετασχηματίζονται μαζί με το γραφικό, εκτός αν ένας μετασχηματισμός ή το μενού του πλαισίου Μετασχηματισμός επιλέξει κάτι άλλο. Live corner radii scale with the art, unless the scale chooses otherwise. Οι ακτίνες των δυναμικών γωνιών κλιμακώνονται μαζί με το γραφικό, εκτός αν η κλιμάκωση επιλέξει κάτι άλλο. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 3f83e928e4..08b4fc2693 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3315,7 +3315,7 @@ digits Malayalam Malayálam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selección › Igual › Color de relleno, Color de trazo y Relleno y trazo solo coinciden con el mismo matiz de una muestra global o de tinta plana, no con cualquier matiz de ella. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Muestra la pantalla de inicio cuando no hay ningún documento abierto; desactivada, la ventana queda vacía hasta que hace clic en Inicio. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mide los objetos con sus trazos y los efectos que cambian su forma para el tamaño, la posición y la alineación; las sombras, los resplandores y los desenfoques no se miden. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Con un zoom del 100 %, una pulgada del documento ocupa 96 puntos de pantalla en lugar de 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Con un zoom del 100 %, una pulgada del documento ocupa una pulgada de la pantalla, o 96 puntos de pantalla si el sistema no indica su tamaño. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Al hacer doble clic en un grupo, trazado o imagen con la herramienta Selección, se abre en modo de aislamiento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Los rellenos y trazos de motivo se transforman con la ilustración, salvo que una transformación o el menú del panel Transformar indique otra cosa. Live corner radii scale with the art, unless the scale chooses otherwise. Los radios de esquina dinámicos se escalan con la ilustración, salvo que el escalado indique otra cosa. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index a4d85b23e8..c712366c71 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4715,7 +4715,7 @@ font-technology Variable Muuttuvat Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Valinta › Sama › Täyttöväri, Viivan väri sekä Täyttö ja viiva löytävät vain globaalin tai spottivärimallin saman sävyn, eivät mitä tahansa sen sävyä. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Näyttää aloitusnäytön, kun yhtään asiakirjaa ei ole auki; kun asetus ei ole käytössä, ikkuna pysyy tyhjänä, kunnes napsautat Aloitus. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mittaa objektit viivoineen ja muotoa muuttavine tehosteineen kokoa, sijaintia ja tasausta varten; varjoja, hehkuja ja sumennuksia ei mitata. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100 %:n zoomauksella asiakirjan tuuma vie 96 näyttöpistettä 72:n sijaan. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100 %:n zoomauksella asiakirjan tuuma täyttää näytön tuuman, tai 96 näyttöpistettä, jos järjestelmä ei ilmoita näytön kokoa. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ryhmän, polun tai kuvan kaksoisnapsautus Valinta-työkalulla avaa sen eristystilaan. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Kuviotäytöt ja -viivat muuntuvat grafiikan mukana, ellei muunnos tai Muunna-paneelin valikko valitse toisin. Live corner radii scale with the art, unless the scale chooses otherwise. Dynaamisten kulmien säteet skaalautuvat grafiikan mukana, ellei skaalaus valitse toisin. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8f56486157..384add6e6f 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3303,7 +3303,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Sélection › Identique › Couleur de fond, Couleur du contour et Fond et contour ne retiennent que la même teinte d’une nuance globale ou d’une couleur d’accompagnement, et non toutes ses teintes. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Affiche l’écran d’accueil quand aucun document n’est ouvert. Désactivée, la fenêtre reste vide jusqu’à ce que vous cliquiez sur Accueil. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mesure les objets avec leurs contours et leurs effets qui modifient la forme pour la taille, la position et l’alignement. Les ombres, lueurs et flous ne sont pas mesurés. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. À 100 % de zoom, un pouce du document occupe 96 points d’écran au lieu de 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. À 100 % de zoom, un pouce du document occupe un pouce de l’écran, ou 96 points d’écran si le système n’indique pas la taille de l’écran. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Un double-clic sur un groupe, un tracé ou une image avec l’outil Sélection l’ouvre en mode Isolation. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Les fonds et contours de motif se transforment avec l’illustration, sauf si une transformation ou le menu du panneau Transformation en décide autrement. Live corner radii scale with the art, unless the scale chooses otherwise. Les rayons d’angle dynamiques se mettent à l’échelle avec l’illustration, sauf si la mise à l’échelle en décide autrement. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 0bb7c9b71f..c9b4e617f7 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3370,7 +3370,7 @@ arrowhead Feather પીંછું Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. પસંદ કરો › સમાન › ભરવાનો રંગ, સ્ટ્રોક રંગ અને ભરો અને સ્ટ્રોક ફક્ત ગ્લોબલ કે સ્પોટ સ્વૉચના એ જ ટિન્ટ સાથે મેળ ખાય છે, તેના કોઈપણ ટિન્ટ સાથે નહીં. Shows the Home screen when no document is open; off, the window stays empty until you click Home. કોઈ દસ્તાવેજ ખુલ્લો ન હોય ત્યારે હોમ સ્ક્રીન બતાવે છે; બંધ હોય ત્યારે તમે હોમ પર ક્લિક ન કરો ત્યાં સુધી વિન્ડો ખાલી રહે છે. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. કદ, સ્થાન અને ગોઠવણી માટે ઑબ્જેક્ટને તેમના સ્ટ્રોક અને આકાર બદલતી ઇફેક્ટ્સ સાથે માપે છે; છાયા, ગ્લો અને બ્લર માપવામાં આવતા નથી. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100% ઝૂમ પર દસ્તાવેજનો એક ઇંચ 72 ને બદલે 96 સ્ક્રીન પોઇન્ટ લે છે. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% ઝૂમ પર દસ્તાવેજનો એક ઇંચ ડિસ્પ્લેનો એક ઇંચ ભરે છે, અથવા સિસ્ટમ ડિસ્પ્લેનું કદ ન જણાવે ત્યારે 96 સ્ક્રીન પોઇન્ટ લે છે. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. પસંદગી ટૂલથી ગ્રુપ, પાથ કે છબી પર ડબલ-ક્લિક કરવાથી તે આઇસોલેશન મોડમાં ખુલે છે. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. પૅટર્ન ભરણ અને સ્ટ્રોક આર્ટવર્ક સાથે ટ્રાન્સફોર્મ થાય છે, સિવાય કે કોઈ ટ્રાન્સફોર્મ કે ટ્રાન્સફોર્મ પેનલનું મેનૂ બીજું પસંદ કરે. Live corner radii scale with the art, unless the scale chooses otherwise. લાઇવ ખૂણાઓની ત્રિજ્યાઓ આર્ટવર્ક સાથે સ્કેલ થાય છે, સિવાય કે સ્કેલિંગ બીજું પસંદ કરે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index e9509d9202..4f875c707c 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4698,7 +4698,7 @@ arrowhead Feather पंख Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. सिलेक्ट › समान › फ़िल रंग, स्ट्रोक रंग और फ़िल व स्ट्रोक केवल ग्लोबल या स्पॉट स्वॉच के उसी टिंट से मेल खाते हैं, उसके किसी भी टिंट से नहीं। Shows the Home screen when no document is open; off, the window stays empty until you click Home. कोई डॉक्यूमेंट खुला न होने पर होम स्क्रीन दिखाता है; बंद होने पर विंडो तब तक खाली रहती है जब तक आप होम पर क्लिक नहीं करते। Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. साइज़, स्थिति और संरेखण के लिए ऑब्जेक्ट को उनके स्ट्रोक और आकार बदलने वाले इफ़ेक्ट के साथ मापता है; छाया, ग्लो और ब्लर नहीं मापे जाते। - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100% ज़ूम पर डॉक्यूमेंट का एक इंच 72 की जगह 96 स्क्रीन पॉइंट लेता है। + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% ज़ूम पर डॉक्यूमेंट का एक इंच डिस्प्ले का एक इंच घेरता है, या सिस्टम डिस्प्ले का आकार न बताए तो 96 स्क्रीन पॉइंट लेता है। Double-clicking a group, path or image with the Selection tool opens it in isolation mode. सिलेक्शन टूल से किसी ग्रुप, पाथ या इमेज पर डबल-क्लिक करने से वह आइसोलेशन मोड में खुलता है। Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. पैटर्न वाले फ़िल और स्ट्रोक आर्टवर्क के साथ रूपांतरित होते हैं, जब तक कोई रूपांतरण या रूपांतरण पैनल का मेनू कुछ और न चुने। Live corner radii scale with the art, unless the scale chooses otherwise. लाइव कोनों की त्रिज्याएँ आर्टवर्क के साथ स्केल होती हैं, जब तक स्केलिंग कुछ और न चुने। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 87f050ef0d..d14fb0bced 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3903,7 +3903,7 @@ mark-style Japanese Japán Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. A Kijelölés › Azonos › Kitöltőszín, Körvonalszín és Kitöltés és körvonal csak egy globális vagy direkt színminta azonos árnyalatát találja meg, nem bármely árnyalatát. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Megjeleníti a kezdőképernyőt, ha nincs megnyitott dokumentum; kikapcsolva az ablak üres marad, amíg a Kezdőképernyő gombra nem kattint. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Az objektumokat körvonalaikkal és alakmódosító effektusaikkal együtt méri a mérethez, a pozícióhoz és az igazításhoz; az árnyékokat, ragyogásokat és elmosásokat nem méri. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100%-os nagyításnál a dokumentum egy hüvelyke 72 helyett 96 képernyőpontot foglal el. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100%-os nagyításnál a dokumentum egy hüvelyke a kijelző egy hüvelykét tölti ki, vagy 96 képernyőpontot, ha a rendszer nem adja meg a kijelző méretét. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ha a Kijelölés eszközzel duplán kattint egy csoportra, útvonalra vagy képre, az elkülönítő módban nyílik meg. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. A mintázatos kitöltések és körvonalak a grafikával együtt alakulnak át, hacsak egy átalakítás vagy az Átalakítás panel menüje mást nem választ. Live corner radii scale with the art, unless the scale chooses otherwise. Az élő sarkok sugara a grafikával együtt méreteződik, hacsak a méretezés mást nem választ. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 924d3d80b5..ec6c655037 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5119,7 +5119,7 @@ font-technology Variable Variabel Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seleksi › Sama › Warna isian, Warna stroke, dan Isian & stroke hanya mencocokkan tint yang sama dari swatch global atau spot, bukan sembarang tint-nya. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Menampilkan layar Home saat tidak ada dokumen yang terbuka; saat nonaktif, jendela tetap kosong sampai Anda mengklik Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mengukur objek beserta stroke dan efek yang mengubah bentuknya untuk ukuran, posisi, dan perataan; bayangan, cahaya, dan kekaburan tidak diukur. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Pada zum 100%, satu inci dokumen memakai 96 titik layar, bukan 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Pada zum 100%, satu inci dokumen mengisi satu inci layar, atau 96 titik layar bila sistem tidak melaporkan ukuran layar. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Mengklik ganda grup, jalur, atau gambar dengan alat Seleksi membukanya dalam mode isolasi. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Isian dan stroke pola ikut bertransformasi dengan karya seni, kecuali transformasi atau menu panel Transformasi memilih lain. Live corner radii scale with the art, unless the scale chooses otherwise. Radius sudut dinamis ikut diskalakan dengan karya seni, kecuali penskalaan memilih lain. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 5f47e3f117..451efa2381 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3364,7 +3364,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selezione › Uguale › Colore riempimento, Colore traccia e Riempimento e traccia trovano solo la stessa tinta di un campione globale o di un colore spot, non qualsiasi sua tinta. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra la schermata Home quando nessun documento è aperto; se disattivata, la finestra resta vuota finché non fai clic su Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Misura gli oggetti con le tracce e gli effetti che ne cambiano la forma per dimensioni, posizione e allineamento; ombre, bagliori e sfocature non vengono misurati. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Allo zoom del 100%, un pollice del documento occupa 96 punti dello schermo invece di 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Allo zoom del 100%, un pollice del documento occupa un pollice dello schermo, o 96 punti dello schermo se il sistema non ne indica le dimensioni. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Un doppio clic su un gruppo, un tracciato o un'immagine con lo strumento Selezione lo apre in modalità isolamento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. I riempimenti e le tracce con motivo si trasformano con la grafica, a meno che una trasformazione o il menu del pannello Trasforma scelga diversamente. Live corner radii scale with the art, unless the scale chooses otherwise. I raggi degli angoli dinamici si ridimensionano con la grafica, a meno che il ridimensionamento scelga diversamente. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 9a1b5f6354..e1e9cf8bc4 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3332,7 +3332,7 @@ mark-style Japanese 日本式 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 選択 › 共通 › カラー (塗り)、カラー (線)、塗りと線は、グローバルスウォッチまたは特色スウォッチの同じ濃度だけを選び、ほかの濃度は選びません。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. ドキュメントが開いていないときにホーム画面を表示します。オフのときは、ホームをクリックするまでウィンドウは空のままです。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. サイズ、位置、整列のために、線と形を変える効果を含めてオブジェクトを測ります。ドロップシャドウ、光彩、ぼかしは含めません。 - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100% 表示のとき、ドキュメントの 1 インチを 72 ではなく 96 スクリーンポイントで表示します。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% 表示のとき、ドキュメントの 1 インチをディスプレイの 1 インチで表示します。システムがディスプレイのサイズを報告しない場合は 96 スクリーンポイントで表示します。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 選択ツールでグループ、パス、画像をダブルクリックすると、編集モードで開きます。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 変形コマンドや変形パネルのメニューで別の指定をしない限り、パターンの塗りと線をアートワークと一緒に変形します。 Live corner radii scale with the art, unless the scale chooses otherwise. 拡大・縮小で別の指定をしない限り、ライブコーナーの半径をアートワークと一緒に拡大・縮小します。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 8eeacee621..513b6ff533 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6506,7 +6506,7 @@ font-technology Variable ცვლადი Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. მონიშვნა › იგივე › შევსების ფერი, კონტურის ფერი და შევსება და კონტური პოულობს გლობალური ან სპოტ-ფერის ნიმუშის მხოლოდ იმავე ტონირებას და არა მის ნებისმიერ ტონირებას. Shows the Home screen when no document is open; off, the window stays empty until you click Home. აჩვენებს საწყის ეკრანს, როცა არცერთი დოკუმენტი არ არის გახსნილი; გამორთვისას ფანჯარა ცარიელი რჩება, „საწყის ეკრანზე“ დაწკაპუნებამდე. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. ზომის, პოზიციისა და სწორების დროს ობიექტებს ზომავს კონტურებითა და ფორმის შემცვლელი ეფექტებით; ჩრდილები, ნათება და გაბუნდოვნება არ იზომება. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100%-იან მასშტაბზე დოკუმენტის ერთი დუიმი 72-ის ნაცვლად 96 ეკრანის პუნქტს იკავებს. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100%-იან მასშტაბზე დოკუმენტის ერთი დუიმი ეკრანის ერთ დუიმს ავსებს, ან 96 ეკრანის პუნქტს, როცა სისტემა ეკრანის ზომას არ აცნობებს. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. მონიშვნის ხელსაწყოთი ჯგუფზე, ტრაექტორიაზე ან გამოსახულებაზე ორჯერ დაწკაპუნება მას იზოლაციის რეჟიმში ხსნის. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. პატერნის შევსებები და კონტურები ნახატთან ერთად გარდაიქმნება, თუ გარდაქმნა ან გარდაქმნის პანელის მენიუ სხვას არ აირჩევს. Live corner radii scale with the art, unless the scale chooses otherwise. ცოცხალი კუთხეების რადიუსები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 57e0b8be10..84e309e056 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3321,7 +3321,7 @@ mark-style Japanese 일본식 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 선택 › 동일 › 칠 색상, 선 색상, 칠 및 선은 전역 또는 별색 견본의 같은 색조만 찾고, 다른 색조는 찾지 않습니다. Shows the Home screen when no document is open; off, the window stays empty until you click Home. 열린 문서가 없을 때 홈 화면을 표시합니다. 끄면 홈을 클릭할 때까지 창이 비어 있습니다. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 크기, 위치, 정렬을 위해 선과 모양을 바꾸는 효과를 포함하여 개체를 측정합니다. 그림자, 광선, 흐림 효과는 측정하지 않습니다. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100% 확대/축소에서 문서의 1인치가 72가 아닌 96 화면 포인트를 차지합니다. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% 확대/축소에서 문서의 1인치가 디스플레이의 1인치를 채우며, 시스템이 디스플레이 크기를 알려 주지 않으면 96 화면 포인트를 차지합니다. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 선택 도구로 그룹, 패스 또는 이미지를 두 번 클릭하면 격리 모드로 엽니다. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 변형 명령이나 변형 패널의 메뉴에서 달리 선택하지 않는 한, 패턴 칠과 선이 아트웍과 함께 변형됩니다. Live corner radii scale with the art, unless the scale chooses otherwise. 크기 조정에서 달리 선택하지 않는 한, 라이브 모퉁이 반지름이 아트웍과 함께 크기 조정됩니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 5ed5cdc3e0..4dbafaa5a5 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5119,7 +5119,7 @@ font-technology Variable Variabel Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selecteren › Zelfde › Vulkleur, Contourkleur en Vulling en contour vinden alleen dezelfde tint van een globaal of steunkleurstaal, niet elke tint ervan. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Toont het startscherm wanneer er geen document open is; uitgeschakeld blijft het venster leeg totdat u op Home klikt. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Meet objecten met hun contouren en vormveranderende effecten voor grootte, positie en uitlijning; schaduwen, gloed en vervagingen worden niet gemeten. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Bij 100% zoom neemt één inch van het document 96 schermpunten in beslag in plaats van 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Bij 100% zoom vult één inch van het document één inch van het scherm, of 96 schermpunten als het systeem geen schermgrootte doorgeeft. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dubbelklikken op een groep, pad of afbeelding met het gereedschap Selectie opent die in de isolatiemodus. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Patroonvullingen en -contouren transformeren mee met de illustratie, tenzij een transformatie of het menu van het deelvenster Transformeren anders kiest. Live corner radii scale with the art, unless the scale chooses otherwise. Dynamische hoekradii schalen mee met de illustratie, tenzij het schalen anders kiest. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 74029133dc..46d2cc120b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4648,7 +4648,7 @@ font-technology Variable Zmienne Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Zaznacz › Taki sam › Kolor wypełnienia, Kolor obrysu oraz Wypełnienie i obrys dopasowują tylko ten sam odcień globalnej lub dodatkowej próbki, a nie dowolny jej odcień. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Pokazuje stronę startową, gdy nie jest otwarty żaden dokument; po wyłączeniu okno pozostaje puste, dopóki nie klikniesz Strona startowa. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mierzy obiekty razem z obrysami i efektami zmieniającymi kształt na potrzeby rozmiaru, położenia i wyrównania; cienie, poświaty i rozmycia nie są mierzone. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Przy powiększeniu 100% jeden cal dokumentu zajmuje 96 punktów ekranu zamiast 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Przy powiększeniu 100% jeden cal dokumentu wypełnia jeden cal ekranu albo 96 punktów ekranu, gdy system nie podaje rozmiaru ekranu. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dwukrotne kliknięcie grupy, ścieżki lub obrazu narzędziem Zaznaczanie otwiera je w trybie izolacji. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Wypełnienia i obrysy wzorkiem przekształcają się razem z kompozycją, chyba że przekształcenie lub menu panelu Przekształć wybierze inaczej. Live corner radii scale with the art, unless the scale chooses otherwise. Promienie narożników dynamicznych skalują się razem z kompozycją, chyba że skalowanie wybierze inaczej. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index a1747af0b2..7e03fc77f0 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2770,7 +2770,7 @@ digits Malayalam Malaiala Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seleção › Igual › Cor de Preenchimento, Cor do Traçado e Preenchimento e Traçado encontram apenas o mesmo tom de uma amostra global ou de cor especial, não qualquer tom dela. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra a tela Início quando nenhum documento está aberto; desativada, a janela fica vazia até você clicar em Início. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mede os objetos com seus traçados e efeitos que mudam a forma para tamanho, posição e alinhamento; sombras, brilhos e desfoques não são medidos. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Com zoom de 100%, uma polegada do documento ocupa 96 pontos de tela em vez de 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Com zoom de 100%, uma polegada do documento ocupa uma polegada da tela, ou 96 pontos de tela quando o sistema não informa o tamanho da tela. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Clicar duas vezes em um grupo, demarcador ou imagem com a ferramenta Seleção o abre no modo de isolamento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Preenchimentos e traçados de padrão se transformam com a arte, a menos que uma transformação ou o menu do painel Transformar escolha outra coisa. Live corner radii scale with the art, unless the scale chooses otherwise. Os raios de canto dinâmicos mudam de escala com a arte, a menos que a escala escolha outra coisa. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ca0c8d5145..731d09bd06 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3346,7 +3346,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. «Выделение › То же › Цвет заливки», «Цвет обводки» и «Заливка и обводка» находят только тот же оттенок глобального или плашечного образца, а не любой его оттенок. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показывает начальный экран, когда нет открытых документов; если выключено, окно остаётся пустым, пока вы не нажмёте «Домой». Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Измеряет объекты с обводками и эффектами, меняющими форму, для размера, положения и выравнивания; тени, свечения и размытия не учитываются. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. При масштабе 100 % один дюйм документа занимает 96 экранных пунктов вместо 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. При масштабе 100 % один дюйм документа занимает один дюйм дисплея или 96 экранных пунктов, если система не сообщает размер дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Двойной щелчок по группе, контуру или изображению инструментом «Выделение» открывает их в режиме изоляции. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Заливки и обводки узором трансформируются вместе с графикой, если трансформирование или меню панели «Трансформировать» не задаёт иное. Live corner radii scale with the art, unless the scale chooses otherwise. Радиусы динамических углов масштабируются вместе с графикой, если масштабирование не задаёт иное. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index c26474cf93..597a5dbc1e 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3235,7 +3235,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Markera › Samma › Fyllnadsfärg, Konturfärg och Fyllning och kontur hittar bara samma nyans av ett globalt färgprov eller en dekorfärg, inte vilken nyans som helst av det. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Visar startskärmen när inget dokument är öppet; när det är av förblir fönstret tomt tills du klickar på Start. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mäter objekt med deras konturer och formändrande effekter för storlek, position och justering; skuggor, glöd och oskärpa mäts inte. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Vid 100 % zoom tar en tum av dokumentet upp 96 skärmpunkter i stället för 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Vid 100 % zoom fyller en tum av dokumentet en tum av skärmen, eller 96 skärmpunkter om systemet inte anger skärmens storlek. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dubbelklick på en grupp, en bana eller en bild med verktyget Markering öppnar den i isoleringsläge. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Mönsterfyllningar och -konturer transformeras med grafiken, om inte en transformering eller menyn i panelen Transformera väljer annat. Live corner radii scale with the art, unless the scale chooses otherwise. Dynamiska hörnradier skalas med grafiken, om inte skalningen väljer annat. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 82186ebcdd..b4b8af414f 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3080,7 +3080,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seçim › Aynı › Dolgu Rengi, Kontur Rengi ve Doldur ve Konturla yalnızca genel veya spot renk örneğinin aynı tonunu bulur, herhangi bir tonunu değil. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Hiçbir belge açık değilken Ana Sayfa ekranını gösterir; kapalıyken siz Ana Sayfa'ya tıklayana kadar pencere boş kalır. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Nesneleri boyut, konum ve hizalama için konturları ve şekil değiştiren efektleriyle birlikte ölçer; gölgeler, parlamalar ve bulanıklaştırmalar ölçülmez. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. %100 yakınlaştırmada belgenin bir inçi 72 yerine 96 ekran noktası kaplar. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. %100 yakınlaştırmada belgenin bir inçi ekranın bir inçini kaplar; sistem ekran boyutunu bildirmezse 96 ekran noktası kaplar. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Seçim aracıyla bir gruba, yola veya görüntüye çift tıklamak onu yalıtım modunda açar. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Desen dolguları ve konturları, bir dönüşüm veya Dönüştür panelinin menüsü başka bir seçim yapmadıkça resimle birlikte dönüşür. Live corner radii scale with the art, unless the scale chooses otherwise. Canlı köşe yarıçapları, ölçekleme başka bir seçim yapmadıkça resimle birlikte ölçeklenir. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index de3329ef10..1be9d21a56 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3356,7 +3356,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. «Виділення › Те саме › Колір заливки», «Колір обведення» та «Заливка та обведення» знаходять лише той самий відтінок глобального або плашкового зразка, а не будь-який його відтінок. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показує початковий екран, коли немає відкритих документів; якщо вимкнено, вікно лишається порожнім, доки ви не натиснете «Додому». Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Вимірює об’єкти з обведеннями та ефектами, що змінюють форму, для розміру, положення й вирівнювання; тіні, світіння та розмиття не враховуються. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. За масштабу 100 % один дюйм документа займає 96 екранних пунктів замість 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. За масштабу 100 % один дюйм документа займає один дюйм дисплея або 96 екранних пунктів, якщо система не повідомляє розмір дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Подвійне клацання на групі, контурі або зображенні інструментом «Виділення» відкриває їх у режимі ізоляції. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Заливки й обведення візерунком трансформуються разом із графікою, якщо трансформування або меню панелі «Трансформувати» не задає іншого. Live corner radii scale with the art, unless the scale chooses otherwise. Радіуси динамічних кутів масштабуються разом із графікою, якщо масштабування не задає іншого. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 675143a8d6..5bc97afbae 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3676,7 +3676,7 @@ mark-style Japanese Kiểu Nhật Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Vùng chọn › Giống nhau › Màu tô, Màu nét và Tô & Nét chỉ khớp với cùng sắc độ của một mẫu màu toàn cục hoặc màu pha, không phải mọi sắc độ của nó. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Hiển thị màn hình Trang chủ khi không có tài liệu nào mở; khi tắt, cửa sổ để trống cho đến khi bạn nhấp vào Trang chủ. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Đo đối tượng cùng với nét và các hiệu ứng thay đổi hình dạng cho kích thước, vị trí và căn chỉnh; bóng đổ, ánh sáng và làm mờ không được đo. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. Ở mức thu phóng 100%, một inch của tài liệu chiếm 96 điểm màn hình thay vì 72. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Ở mức thu phóng 100%, một inch của tài liệu chiếm một inch trên màn hình, hoặc 96 điểm màn hình khi hệ thống không báo kích thước màn hình. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Nhấp đúp vào một nhóm, đường dẫn hoặc hình ảnh bằng công cụ Vùng chọn sẽ mở nó trong chế độ cô lập. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Phần tô và nét họa tiết biến đổi cùng hình minh họa, trừ khi phép biến đổi hoặc menu của bảng Biến đổi chọn khác. Live corner radii scale with the art, unless the scale chooses otherwise. Bán kính góc động co giãn cùng hình minh họa, trừ khi phép co giãn chọn khác. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 57f6a4403b..fd591e2ff4 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3205,7 +3205,7 @@ digits Malayalam 马拉雅拉姆数字 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 选择 › 相同 › 填色、描边颜色和填色和描边只匹配全局色板或专色色板的相同色调,而不是其任意色调。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. 没有打开文档时显示主页屏幕;关闭时,窗口保持空白,直到你点击主页。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 在尺寸、位置和对齐中按对象的描边和改变形状的效果测量对象;阴影、发光和模糊不计入测量。 - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 缩放为 100% 时,文档的一英寸占 96 个屏幕点,而不是 72 个。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 缩放为 100% 时,文档的一英寸占显示器上的一英寸;系统未报告显示器尺寸时占 96 个屏幕点。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 用选择工具双击编组、路径或图像时,会在隔离模式中打开它。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 图案填色和描边随图稿一起变换,除非变换命令或变换面板的菜单另有选择。 Live corner radii scale with the art, unless the scale chooses otherwise. 实时转角半径随图稿一起缩放,除非缩放命令另有选择。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 9834c17ea6..a7136b8c76 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4654,7 +4654,7 @@ digits Malayalam 馬來亞拉姆數字 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 選取 › 相同 › 填色顏色、筆畫顏色和填色與筆畫只符合全域色票或特別色色票的相同色調,而不是其任意色調。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. 沒有開啟文件時顯示首頁畫面;關閉時,視窗保持空白,直到你按下首頁。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 在尺寸、位置和對齊中依物件的筆畫和改變形狀的效果測量物件;陰影、光暈和模糊不計入測量。 - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 縮放為 100% 時,文件的一英吋佔 96 個螢幕點,而不是 72 個。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 縮放為 100% 時,文件的一英吋佔顯示器上的一英吋;系統未回報顯示器尺寸時佔 96 個螢幕點。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 用選取工具按兩下群組、路徑或影像時,會在隔離模式中開啟它。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 圖樣填色和筆畫隨圖稿一起變形,除非變形指令或變形面板的選單另有選擇。 Live corner radii scale with the art, unless the scale chooses otherwise. 即時轉角半徑隨圖稿一起縮放,除非縮放指令另有選擇。 diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index a50527cede..40889e76ae 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -129,7 +129,7 @@ pub use craft_ui::docking::Monitor as DockMonitor; pub(crate) use services::browsable_url; pub use services::{ DownloadFn, ExistsFn, FileFilter, FilePick, Inbox, NativeInputHook, OpenUrlFn, PickOpen, PickSave, PickedInbox, ReadFn, RevealFn, SaveStreamFn, - SaveWriteFn, Services, WriteFn, + SaveWriteFn, ScreenDensity, ScreenPpi, Services, WriteFn, }; use state::{GeometryStamp, InputGeneration, PendingScreenshot, QueuedScreenshot}; pub(crate) use state::{InputFrame, take_frame_once}; diff --git a/crates/ui-egui/src/panels/navigator.rs b/crates/ui-egui/src/panels/navigator.rs index c1307871db..89df32b658 100644 --- a/crates/ui-egui/src/panels/navigator.rs +++ b/crates/ui-egui/src/panels/navigator.rs @@ -298,12 +298,19 @@ fn view_box(region: DRect, thumb: Rect, canvas: Rect, v: &crate::state::View, ui pts } -/// Slider position (0..1) ↔ zoom percent on a log range, 3.13 %–64 000 %. -pub fn zoom_to_slider(z: f64) -> f64 { - ((z.clamp(3.13, 64000.0)).ln() - 3.13f64.ln()) / (64000f64.ln() - 3.13f64.ln()) +/// Slider position (0..1) ↔ zoom percent on a log range from `lo` % to `hi` % ([`zoom_range`]). +pub fn zoom_to_slider(z: f64, (lo, hi): (f64, f64)) -> f64 { + ((z.clamp(lo, hi)).ln() - lo.ln()) / (hi.ln() - lo.ln()) } -pub fn slider_to_zoom(t: f64) -> f64 { - (3.13f64.ln() + t.clamp(0.0, 1.0) * (64000f64.ln() - 3.13f64.ln())).exp() +pub fn slider_to_zoom(t: f64, (lo, hi): (f64, f64)) -> f64 { + (lo.ln() + t.clamp(0.0, 1.0) * (hi.ln() - lo.ln())).exp() +} + +/// The zoom range in the percentages the zoom field shows, with 100% at Actual Size: 3.13 %–64 000 % +/// at one document point per screen point. +fn zoom_range(print: Option) -> (f64, f64) { + let baseline = crate::state::zoom_baseline(print); + (3.13 / baseline, 64000.0 / baseline) } pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { @@ -346,6 +353,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } // The view box: the canvas's corners in the document, turned with the view, cut to the thumbnail. let view = app.view().copied(); + // The zoom as the zoom field and `view.setZoom` count it, with 100% at Actual Size. + let print = app.print_ppi(); + let zoom = view.map_or(100.0, |v| crate::state::zoom_display_percent(v.zoom, print)); if let (Some(v), Some(cr)) = (view, app.canvas_rect) { let box_points = view_box(region, thumb, cr, &v, app.canvas_ui_zoom); if box_points.len() > 2 { @@ -356,12 +366,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { && let Some(p) = resp.interact_pointer_pos() { let c = thumb_to_doc(region, thumb, p); - app.run("view.setZoom", json!({"zoom": v.zoom * 100.0, "center": [c.x, c.y]})).ok(); + app.run("view.setZoom", json!({"zoom": zoom, "center": [c.x, c.y]})).ok(); } } ui.painter().rect_stroke(thumb, 0.0, Stroke::new(1.0, t.border), StrokeKind::Outside); // Zoom controls. - let zoom = view.map(|v| v.zoom * 100.0).unwrap_or(100.0); ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 4.0; let mut z = None; @@ -373,17 +382,19 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } let sw = (ui.available_width() - 30.0).max(40.0); let track = |_: f32| t.input_border; - let shown = widgets::SliderValue::field(zoom, 3.13..=64000.0, "%", 2); - if let (Some(v), phase) = widgets::color_slider_valued(ui, "nav-slider", tl!("Zoom"), Some(shown), zoom_to_slider(zoom) as f32, sw, &track) + let range = zoom_range(print); + let shown = widgets::SliderValue::field(zoom, range.0..=range.1, "%", 2); + if let (Some(v), phase) = + widgets::color_slider_valued(ui, "nav-slider", tl!("Zoom"), Some(shown), zoom_to_slider(zoom, range) as f32, sw, &track) && phase != widgets::Live::Idle { - z = Some(slider_to_zoom(v as f64)); + z = Some(slider_to_zoom(v as f64, range)); } if widgets::icon_button(ui, "dc-zoom-large", tl!("Zoom In"), false, 22.0).clicked() { app.run("view.zoomIn", json!({})).ok(); } if let Some(z) = z { - app.run("view.setZoom", json!({"zoom": z.clamp(3.13, 64000.0)})).ok(); + app.run("view.setZoom", json!({"zoom": z.clamp(range.0, range.1)})).ok(); } }); } @@ -402,16 +413,28 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { mod tests { use super::*; - /// Screen readers get the Zoom slider's percent as the zoom field beside it shows it, on the - /// slider's 3.13% to 64000% range. + /// Screen readers get the Zoom slider's percent as the zoom field beside it shows it, counted + /// from Actual Size as `view.setZoom` counts it, on the zoom range: 3.13% to 64000% with + /// Display Print Size at 100% Zoom off, and the same zooms counted from 100% with it on, here + /// on a display of 127 points to an inch. #[test] fn screen_readers_get_the_zoom_the_field_shows() { use crate::widgets::accessibility_tests::{slider_value, tree}; let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); app.run("view.setZoom", json!({"zoom": 250})).unwrap(); let shown = tree(|ui| show(&mut app, ui)); assert_eq!(slider_value(&shown, "Zoom"), (Some(250.0), Some(3.13), Some(64000.0), Some("250%".to_string()))); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("view.setZoom", json!({"zoom": 250})).unwrap(); + let (lo, hi) = zoom_range(app.print_ppi()); + assert!(lo < 3.13 && hi < 64000.0, "a denser display than one point per point reaches less far in: {lo} to {hi}"); + let shown = tree(|ui| show(&mut app, ui)); + let (value, min, max, _) = slider_value(&shown, "Zoom"); + assert!(value.is_some_and(|v| (v - 250.0).abs() < 1e-9), "{value:?}"); + assert!(min.is_some_and(|m| (m - lo).abs() < 1e-6) && max.is_some_and(|m| (m - hi).abs() < 1e-6), "{min:?} to {max:?}"); } #[test] @@ -503,8 +526,8 @@ mod tests { let [points] = &drawn[..] else { panic!("UI Scaling {ui_zoom}×: one view box: {drawn:?}") }; let region = CACHE.with(|c| c.borrow().region.unwrap().1); // Each canvas corner is (its offset from the canvas's center) × UI Scaling / zoom - // document points from the view's center. - let k = f64::from(ui_zoom) / 4.0; + // document points from the view's center, with 400% counted from Actual Size. + let k = f64::from(ui_zoom) / (4.0 * crate::state::zoom_baseline(app.print_ppi())); let want = [canvas.left_top(), canvas.right_top(), canvas.right_bottom(), canvas.left_bottom()].map(|c| { let d = c - canvas.center(); doc_to_thumb(region, thumb, Point::new(200.0 + f64::from(d.x) * k, 150.0 + f64::from(d.y) * k)) @@ -729,9 +752,11 @@ mod tests { #[test] fn zoom_slider_roundtrip() { - assert!((zoom_to_slider(3.13)).abs() < 1e-9); - assert!((zoom_to_slider(64000.0) - 1.0).abs() < 1e-9); - assert!((slider_to_zoom(zoom_to_slider(100.0)) - 100.0).abs() < 1e-6); + let range = zoom_range(None); + assert_eq!(range, (3.13, 64000.0)); + assert!((zoom_to_slider(3.13, range)).abs() < 1e-9); + assert!((zoom_to_slider(64000.0, range) - 1.0).abs() < 1e-9); + assert!((slider_to_zoom(zoom_to_slider(100.0, range), range) - 100.0).abs() < 1e-6); } /// The navigator images made on this thread so far. diff --git a/crates/ui-egui/src/services.rs b/crates/ui-egui/src/services.rs index 0fdf34b526..5160b2a222 100644 --- a/crates/ui-egui/src/services.rs +++ b/crates/ui-egui/src/services.rs @@ -224,13 +224,73 @@ pub struct Services { /// (before UI Scaling) per inch, from the physical size the system reports for that display. /// The desktop host keeps it current as the window moves between displays. With Display Print /// Size at 100% Zoom, 100% shows one document inch in this many points ([`crate::state::print_ppi`]). - /// `None` on the web and where the system reports no size, and then an inch takes 96 points. - pub screen_ppi: Option, + /// [`ScreenPpi::Unread`] on the web and until the host's first reading; a display that + /// reports no size reads as `Read(None)`. Either way an inch then takes 96 points. The views + /// the main window shows count from it; a document floating in an OS window of its own counts + /// from the display that shows that window ([`Self::screens`]). + pub screen_ppi: ScreenPpi, + /// The connected displays with their densities, kept current by the desktop host while + /// Display Print Size at 100% Zoom is on, for the document windows floating in OS windows of + /// their own ([`screen_ppi_at`]). Empty on the web. + pub screens: Vec, /// The text Help › Copy Troubleshooting Info copies (desktop: the platform, the graphics /// processor, recent commands and frame times, and the hang reports of this session and the /// one before). Without it the command copies the version only ([`crate::troubleshooting`]). pub troubleshooting: Option String>>, } +/// The density of a display as far as the host has read it ([`Services::screen_ppi`]). +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub enum ScreenPpi { + /// Not read yet. + #[default] + Unread, + /// Read: its points to an inch, `None` for a display that reports no physical size. + Read(Option), +} + +impl ScreenPpi { + /// The points to an inch, when the display was read and reports a size. + pub fn ppi(self) -> Option { + match self { + Self::Read(ppi) => ppi, + Self::Unread => None, + } + } +} + +/// A connected display ([`Services::screens`]): where it is on the desktop, in the physical pixels +/// winit gives its position and size in, its scale factor, and its density in points (at that +/// scale factor) per inch: `Read(None)` where the system reports no physical size for it, and +/// unread while it has not answered. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct ScreenDensity { + /// Left, top, width and height in physical pixels. + pub rect: [i32; 4], + pub scale: f64, + pub ppi: ScreenPpi, +} + +/// The density of the display that shows most of the viewport `ctx` draws, from `screens`: of the +/// displays at the viewport's scale factor, the one whose rect covers the largest part of the +/// viewport, in the physical pixels of that scale factor. On macOS each display's pixels are its +/// points times its own scale factor, so displays of different scales can overlap in those pixels +/// and the scale tells them apart. `None` when the viewport reports no position (Wayland, the web) +/// or covers no display. +pub fn screen_ppi_at(screens: &[ScreenDensity], ctx: &egui::Context) -> Option { + let (rect, ppp, native) = ctx.input(|i| (i.viewport().outer_rect, i.pixels_per_point(), i.viewport().native_pixels_per_point)); + let (rect, ppp, native) = (rect?, f64::from(ppp), f64::from(native?)); + let [l, t, r, b] = [rect.left(), rect.top(), rect.right(), rect.bottom()].map(|v| f64::from(v) * ppp); + if ![l, t, r, b].iter().all(|v| v.is_finite()) { + return None; + } + let covered = |s: &ScreenDensity| { + let [x, y, w, h] = s.rect.map(f64::from); + ((r.min(x + w) - l.max(x)).max(0.0)) * ((b.min(y + h) - t.max(y)).max(0.0)) + }; + let best = screens.iter().filter(|s| (s.scale - native).abs() < 1e-3).map(|s| (covered(s), s)).max_by(|a, b| a.0.total_cmp(&b.0))?; + (best.0 > 0.0).then_some(best.1.ppi) +} + /// Rewrites one window's raw input before egui reads it ([`Services::native_input_hook`]). pub type NativeInputHook = std::sync::Arc; diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index fe30649b14..5a2681e7e7 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -44,11 +44,30 @@ pub struct View { /// document opens in Preview. #[serde(default)] pub outline: bool, + /// The density of the display the view was last shown on ([`crate::Services::screen_ppi`]), + /// which its zoom percentage counts from with Display Print Size at 100% Zoom; `None` until + /// the view was first shown ([`crate::VectorcraftApp::settle_screen_ppi`]). + #[serde(skip)] + pub(crate) shown_ppi: Option, + /// The zoom a fit to the window, or the document's saved view, gave the view. While the view + /// still has it, the first reading of its display leaves the zoom alone; a zoom chosen as a + /// percentage keeps its percentage then ([`crate::VectorcraftApp::settle_screen_ppi`]). + #[serde(skip)] + pub(crate) fit_zoom: Option, } impl Default for View { fn default() -> Self { - Self { zoom: 1.0, center: Point::new(306.0, 396.0), fitted: false, rotation: 0.0, artboard: 0, outline: false } + Self { + zoom: 1.0, + center: Point::new(306.0, 396.0), + fitted: false, + rotation: 0.0, + artboard: 0, + outline: false, + shown_ppi: None, + fit_zoom: None, + } } } @@ -65,13 +84,16 @@ impl View { /// the zoom range; `None` when the canvas can't show it (a zoom or centre that isn't finite, a /// zoom of 0 or less). pub fn saved(v: &vectorcraft_engine::doc::SavedView) -> Option { + let zoom = v.zoom.clamp(0.0313, 640.0); v.is_usable().then(|| Self { - zoom: v.zoom.clamp(0.0313, 640.0), + zoom, + fit_zoom: Some(zoom), center: v.center, fitted: true, rotation: if v.rotation.is_finite() { v.rotation } else { 0.0 }, artboard: 0, outline: false, + shown_ppi: None, }) } @@ -146,13 +168,14 @@ pub fn zoom_from_display_percent(pct: f64, print: Option) -> f64 { } /// The preset zoom stop after zoom `z` (`up`) or before it, counted in the percentages the zoom -/// field shows with 100% at [`zoom_baseline`]`(print)`, kept in the zoom range. +/// field shows with 100% at [`zoom_baseline`]`(print)`, kept in the zoom range. Past the last stop +/// in that direction, the end of the zoom range. pub fn next_zoom(z: f64, up: bool, print: Option) -> f64 { let pct = zoom_display_percent(z, print); let stop = if up { - ZOOM_STOPS.iter().find(|s| **s > pct + 0.01).copied().unwrap_or(64000.0) + ZOOM_STOPS.iter().find(|s| **s > pct + 0.01).copied().unwrap_or_else(|| zoom_display_percent(640.0, print)) } else { - ZOOM_STOPS.iter().rev().find(|s| **s < pct - 0.01).copied().unwrap_or(3.13) + ZOOM_STOPS.iter().rev().find(|s| **s < pct - 0.01).copied().unwrap_or_else(|| zoom_display_percent(0.0313, print)) }; zoom_from_display_percent(stop, print).clamp(0.0313, 640.0) } @@ -1629,8 +1652,11 @@ mod tests { } assert_eq!(zoom_label(zoom_from_display_percent(100.0, dense), dense), "100%"); let thin = print_ppi(true, Some(40.0)); - assert!(next_zoom(0.04, false, thin) >= 0.0313, "the last stop down stays in the zoom range"); + assert!(next_zoom(0.0313, false, thin) >= 0.0313, "the last stop down stays in the zoom range"); assert!(next_zoom(600.0, true, print_ppi(true, Some(900.0))) <= 640.0, "and the last stop up"); + let reference = print_ppi(true, None); + assert!(next_zoom(0.0313, false, reference) <= 0.0313, "past the last stop, zooming out does not zoom in"); + assert!(next_zoom(640.0, true, thin) >= 640.0, "nor zooming in out"); } #[test] diff --git a/crates/ui-egui/src/tests/tab_overflow.rs b/crates/ui-egui/src/tests/tab_overflow.rs index 59af211e17..b2aab999a9 100644 --- a/crates/ui-egui/src/tests/tab_overflow.rs +++ b/crates/ui-egui/src/tests/tab_overflow.rs @@ -91,6 +91,8 @@ fn the_tab_that_does_not_fit_whole_fills_the_rest_of_the_strip() { #[test] fn inactive_tabs_show_the_name_alone_so_more_tabs_fit() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); + // The titles' widths are measured at 100% with one document point per screen point. + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": false})).unwrap(); for i in 0..12 { app.run("file.new", json!({"width": 100, "height": 100, "name": format!("Tab test {i}")})).unwrap(); } diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 4c8c25392d..771411b53a 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -401,7 +401,7 @@ fn double_clicking_the_hand_zoom_and_transform_tools() { let v = *app.view().unwrap(); assert_eq!((v.center.x, v.center.y, v.zoom), (150.0, 100.0, 2.0)); app.run("tool.options", json!({"tool": "zoom"})).unwrap(); - assert_eq!(app.view().unwrap().zoom, 1.0); + assert_eq!(app.view().unwrap().zoom, crate::state::zoom_baseline(app.print_ppi())); // The transform tools open their dialogs, like Object › Transform: not with nothing selected. assert_eq!(app.run("tool.options", json!({"tool": "rotate"})), Err("nothing selected".into())); assert!(app.ui.dialog.is_none()); diff --git a/docs/mcp.md b/docs/mcp.md index bdafc83ef8..8f48dde8d0 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8286,13 +8286,17 @@ their own Anti-aliasing option), `scrubNumericFields` (on: a horizontal drag on a numeric field's label steps the field, one undo step per drag; the control channel's `ui.drag` scrubs), `showHomeScreen` (on by default: the Home screen while no document is open; off, an empty window, and the Home button or `app.home` still shows the screen), `autoCollapseIconPanels` (off by -default: on, a click away from a panel popped out of the icon column puts it away), `displayPrintSize` (off by -default: View › Actual Size / `view.actualSize` is one document point per screen point; on, one document inch fills -an inch of the display that shows the main window, measured from the physical size macOS, Windows, X11 or the -Wayland compositor reports for it and measured again when the window moves to another display, where every -document window keeps its zoom percentage; where the system -reports no size, as on the web, or a size no display has, an inch is 96 screen points). `uiScaling` scales the -interface and not the art: a zoom shows the art at the same size at every UI Scaling. The tool shortcut +default: on, a click away from a panel popped out of the icon column puts it away), `displayPrintSize` (on by +default, also for saved preferences without the key: View › Actual Size / `view.actualSize` shows one document inch +in an inch of the display that shows the document's window, measured from the physical size macOS, Windows, X11 or +the Wayland compositor reports for that display. A document under the tabs counts from the main window's display, +and a document floating in an OS window of its own counts from that window's display. A window that moves to a +display of another density keeps its zoom percentage. Where the system reports no size, as on the web, or a size no +display has, an inch is 96 screen points. A view whose zoom counted from 96 points keeps its zoom when the first +measurement arrives. Off, 100% is one document point per screen point, and the desktop app does not measure the +displays. While it is on, `ui.inspect` gives `screenPpi`, the measured density of the main window's display, and +`printPpi`, the points an inch takes at 100% in the current window; both are null while it is off). `uiScaling` +scales the interface and not the art: a zoom shows the art at the same size at every UI Scaling. The tool shortcut preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s or more, or held while its tool is used, chooses the tool until the key is let go and then returns to the tool active before, after any drag in progress; a quicker press chooses the tool for good. With it off, every press and every key diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 15ad6a5160..f252db9314 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1292,7 +1292,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pen rubber band after a smooth anchor:** the preview segment to the pointer is the curve a click there adds, leaving the last anchor along its outgoing handle and arriving at the new corner anchor without a handle, so the segment keeps its shape when the anchor is placed, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/preview-paths-drawn.html) describes. Before, the preview was a different curve, and the segment changed shape at the click (#8296, in part; `pen::tests::rubber_band_is_the_segment_a_click_adds`); scores and estimates unchanged. - **Pen rubber band over an anchor a click ends on:** over the path's first anchor, the preview segment ends on that anchor, as the closing segment does; over an end of another open path, it ends on that end and arrives along the end's own handle, as the joining segment does. The preview picks these anchors at the pointer before snapping, as a press does. Before, the preview ended at the pointer and arrived without a handle, so the segment moved by up to the pick tolerance at the click, and changed shape when the other end was smooth (#8296, in part; the `pen_rubber_band` tests in `engine/tests/it`); scores and estimates unchanged. - The desktop app keeps the Color panel's Show Options or Hide Options between sessions, and `ui.colorPanel` sets its mode and options as its panel menu does. - - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (off by default: View › Actual Size is one document point per screen point; on, one document inch fills an inch of the display that shows the main window, measured from the physical size the system reports for it, or 96 screen points where it reports none; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). + - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (on by default, as [the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes; in VectorCraft, View › Actual Size shows one document inch in an inch of the display that shows the document's window, measured from the physical size the system reports for that display, or 96 screen points where it reports none; off, one document point per screen point; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). - Preferences › General › Scroll Sideways with Cmd/Ctrl + Wheel (on by default; dimmed while Zoom with Mouse Wheel is on): while Zoom with Mouse Wheel is off, Cmd/Ctrl with a mouse wheel's whole notches scrolls the canvas sideways instead of zooming. Alt + Cmd/Ctrl-wheel and a pinch on a Mac trackpad, on a touch screen or in the web build still zoom about the pointer, and once a trackpad gesture holds Alt, it zooms until it ends, also after Alt is let go. Under either wheel preference, Cmd/Ctrl with a touchpad zooms about the pointer. - Preferences › Type › Highlight Substituted Fonts (on by default) paints pink behind text drawn in a substitute for a missing font in every document, and turning it off removes that highlight everywhere (`prefs.set highlightSubstitutedFonts`); Document Setup keeps Highlight Substituted Glyphs ([help](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html)). - Preferences › User Interface › UI Scaling scales the interface ([help](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/modify-workspaces.html)). VectorCraft's own rule is that it leaves the art's size alone: at a given zoom a document point covers the same device pixels at every UI Scaling, so View › Actual Size shows the art at the same size whatever the UI Scaling. A click, a pinch or wheel zoom about the pointer, a pan, the Zoom tool's marquee, Fit, tiled panes, Pixel Preview and the Navigator's view box use the same mapping. Evidence: `canvas::tests_ui_scaling`, `tiled_documents_fit_their_panes_at_every_ui_scaling`, `the_view_box_outlines_the_canvas_at_every_ui_scaling`. Scores unchanged. From 1a48bd827bb5d8bd46e79c1bf0d90290ce6e2bd4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 04:45:52 -0800 Subject: [PATCH 3/6] Display Print Size: a fit made during a reading counts from the last one A fit made in the main window while its display was being read counted from 96 points to an inch until the reading arrived, so the zoom field, the tab title and the zoom stops counted from a different density than the window's other views. The fit now counts from the last reading, and the reading, when it comes, keeps the fit's zoom, also when the views are settled again before it arrives. An app that draws no frames now still reads the displays again a minute after the last reading: it asks for a frame then. Tests now cover Actual Size after a fit that gave the same zoom, a Navigator thumbnail click, and a floating OS window's display readings (first display, a move, off every display, a fit, and docking back). docs/mcp.md now states which views keep their zoom at the first reading, that X11 and Wayland are read on Linux only, that headless sessions and the CLI count 96 points to an inch, and that the preference also applies in Pixel Preview. The progress line names the two rules that differ from the help page. --- apps/vectorcraft/src/screen_density.rs | 14 ++++++++-- crates/ui-egui/src/app/view.rs | 20 ++++++++++--- crates/ui-egui/src/canvas/tests.rs | 25 +++++++++++++++++ crates/ui-egui/src/doc_windows/tests.rs | 37 +++++++++++++++++++++++++ crates/ui-egui/src/panels/navigator.rs | 36 ++++++++++++++++++++++++ crates/ui-egui/src/state.rs | 7 +++++ docs/mcp.md | 18 +++++++----- docs/target-app-parity.md | 2 +- 8 files changed, 144 insertions(+), 15 deletions(-) diff --git a/apps/vectorcraft/src/screen_density.rs b/apps/vectorcraft/src/screen_density.rs index c89934a3c7..70ba069684 100644 --- a/apps/vectorcraft/src/screen_density.rs +++ b/apps/vectorcraft/src/screen_density.rs @@ -5,13 +5,16 @@ //! //! - macOS: `CGDisplayScreenSize`. //! - Windows: `GetDpiForMonitor`'s raw density (`windows_display_size`). -//! - X11, XWayland included: the RandR output's width and height in millimeters. -//! - Wayland: the physical width and height of the compositor's `wl_output` for the display. +//! - X11 on Linux, XWayland included: the RandR output's width and height in millimeters. +//! - Wayland on Linux: the physical width and height of the compositor's `wl_output` for the display. +//! - Other systems: no size, so an inch takes 96 points. //! //! A display that reports no size, or a size no display has, gives `None`, and an inch then takes //! 96 points. While the preference is on, the displays are listed once a second while the app //! draws. When the list changes, a background thread reads every display's size, and a later -//! frame takes the result. A reading that fails is tried again after [`RETRY_AFTER`] seconds. +//! frame takes the result. A reading that fails is tried again after [`RETRY_AFTER`] seconds, and +//! the displays are read again [`READ_AGAIN_AFTER`] seconds after the last reading; the app draws a +//! frame for each of these when nothing else makes it draw. use std::sync::mpsc::{Receiver, TryRecvError}; @@ -140,6 +143,11 @@ impl Tracker { { let due = (at + RETRY_AFTER).max(self.looked.map_or(0.0, |l| l + LOOK_EVERY)); ctx.request_repaint_after(std::time::Duration::from_secs_f64((due - now).clamp(0.0, RETRY_AFTER))); + } else if enabled && self.running.is_none() && self.read.is_some() { + // An app that is not drawing still lists and reads the displays READ_AGAIN_AFTER seconds + // after the last reading. + let due = (self.read_at + READ_AGAIN_AFTER).max(self.looked.map_or(0.0, |l| l + LOOK_EVERY)); + ctx.request_repaint_after(std::time::Duration::from_secs_f64((due - now).clamp(0.0, READ_AGAIN_AFTER))); } densities } diff --git a/crates/ui-egui/src/app/view.rs b/crates/ui-egui/src/app/view.rs index 383504b49c..f20ad4758f 100644 --- a/crates/ui-egui/src/app/view.rs +++ b/crates/ui-egui/src/app/view.rs @@ -174,8 +174,9 @@ impl VectorcraftApp { } /// [`Self::settle_screen_ppi`] for window `w` alone. With `keep` false (a fit made for the - /// window), the view counts from the display's reading, or from its first reading still to - /// come, without a change of zoom. + /// window), the view counts from the display's reading, without a change of zoom; while the + /// display is being read, it counts from the last reading, and the reading still to come + /// leaves its zoom alone. pub(crate) fn settle_window_ppi(&mut self, w: crate::doc_windows::Win, keep: bool) { let on = self.session.prefs.display_print_size; let now = self.window_ppi(w); @@ -185,10 +186,18 @@ impl VectorcraftApp { // keeps the zoom chosen meanwhile. if !on { v.shown_ppi = Some(crate::ScreenPpi::Unread); + v.fit_unread = false; return; } if !keep { - v.shown_ppi = Some(reading); + // While the display is being read, the fit counts from the last reading, as the other + // views there do, and the reading keeps its zoom. + v.shown_ppi = Some(now); + v.fit_unread = reading == crate::ScreenPpi::Unread; + return; + } + // A fit made while its display is being read waits for that reading. + if v.fit_unread && reading == crate::ScreenPpi::Unread { return; } // A display that has not answered yet leaves the view counting from the last one read, so @@ -197,11 +206,14 @@ impl VectorcraftApp { v.shown_ppi.get_or_insert(now); return; }; + let fitted = v.fit_zoom == Some(v.zoom); let before = match v.shown_ppi { + _ if fitted && v.fit_unread => None, Some(crate::ScreenPpi::Read(before)) => Some(before), - _ if v.fit_zoom == Some(v.zoom) => None, + _ if fitted => None, _ => Some(None), }; + v.fit_unread = false; if let Some(before) = before && before != after && let (Some(b), Some(a)) = (crate::state::print_ppi(on, before), crate::state::print_ppi(on, after)) diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index b72980e082..2576980464 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -8641,6 +8641,8 @@ fn actual_size_and_fits_made_before_a_reading_keep_their_meaning() { assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "the window moved to a display being read"); app.run("view.fitArtboard", json!({})).unwrap(); let fitted = app.view().unwrap().zoom; + assert_eq!(app.print_ppi(), Some(127.0), "meanwhile the fit counts from the last reading, as the window's other views do"); + app.settle_screen_ppi(); assert!(app.set_screen_ppi(Some(190.0))); assert_eq!(app.view().unwrap().zoom, fitted, "the fit was made for this display"); assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "and to another display being read"); @@ -8649,6 +8651,29 @@ fn actual_size_and_fits_made_before_a_reading_keep_their_meaning() { assert!((app.view().unwrap().zoom * 72.0 - 110.0).abs() < 1e-9, "Actual Size there is 100%: {}", app.view().unwrap().zoom * 72.0); } +/// Actual Size chosen before the first reading is still 100% when the reading arrives, also when a +/// fit made before it gave the view the same zoom. A zoom chosen after a fit made while the display +/// is being read keeps its percentage when the reading arrives. +#[test] +fn actual_size_after_a_fit_of_the_same_zoom_stays_at_100_percent() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 300, "height": 100})).unwrap(); + app.canvas_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0))); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.run("view.fitArtboard", json!({})).unwrap(); + assert!((app.view().unwrap().zoom * 72.0 - 96.0).abs() < 1e-9, "the fit has Actual Size's zoom before any reading"); + app.run("view.actualSize", json!({})).unwrap(); + assert!(app.set_screen_ppi(Some(127.0))); + assert!((app.view().unwrap().zoom * 72.0 - 127.0).abs() < 1e-9, "Actual Size keeps 100%: {}", app.view().unwrap().zoom * 72.0); + assert!(app.set_screen_reading(crate::ScreenPpi::Unread), "the window moved to a display being read"); + app.run("view.fitArtboard", json!({})).unwrap(); + app.run("view.zoomIn", json!({})).unwrap(); + let shown = crate::state::zoom_display_percent(app.view().unwrap().zoom, app.print_ppi()); + assert!(app.set_screen_ppi(Some(150.0))); + let now = crate::state::zoom_display_percent(app.view().unwrap().zoom, app.print_ppi()); + assert!((now - shown).abs() < 1e-9, "a zoom chosen after the fit keeps its percentage: {shown} → {now}"); +} + /// Fit Artboard in Window fits the artboard as a rotated view shows it: at 45° every corner is /// on the canvas and one is within the 30-point margin of an edge. At 0° the zoom is unchanged. #[test] diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index d4f280267b..8a001a3748 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -1294,3 +1294,40 @@ fn a_floating_window_counts_100_percent_from_its_own_display() { app.settle_screen_ppi_if_changed(); assert_eq!(app.views[1].zoom, fitted, "the fit is made for the main window's display"); } + +/// What the host found for a floating OS window's display reaches its view: its first display and +/// a move to another keep 100%, a window off every display is unread and keeps its zoom, a fit made +/// in the frame its window reached a new display stays the fit, and the window drawn in the main +/// window again counts from the main window's display. +#[test] +fn a_floating_os_window_takes_the_density_of_the_display_it_is_found_on() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("view.actualSize", json!({})).unwrap(); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let uid = app.session.documents()[1].uid; + let win = (1, 1); + let found = |ppi: Option| Shown { ppi, ..Default::default() }; + let inch = |app: &VectorcraftApp| app.views[1].zoom * 72.0; + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(Some(crate::ScreenPpi::Read(Some(91.0))))); + assert!((inch(&app) - 91.0).abs() < 1e-9, "its first display keeps 100%: {}", inch(&app)); + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(Some(crate::ScreenPpi::Read(Some(150.0))))); + assert!((inch(&app) - 150.0).abs() < 1e-9, "and so does a move to a denser one: {}", inch(&app)); + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(None)); + assert_eq!(screen_ppi(&app, win), Some(crate::ScreenPpi::Unread), "off every display it is unread"); + assert!((inch(&app) - 150.0).abs() < 1e-9, "and keeps its zoom"); + // A fit made in the frame the window reaches a display of another density stays the fit. + app.run("view.fitArtboard", json!({})).unwrap(); + let (zoom, center) = (app.views[1].zoom, app.views[1].center); + let body = egui::Rect::from_min_size(Pos2::ZERO, vec2(500.0, 400.0)); + let mut fitted = + Shown { ppi: Some(crate::ScreenPpi::Read(Some(110.0))), body: Some(body), fit: Some((body.size(), zoom, center)), ..Default::default() }; + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut fitted); + assert_eq!(app.views[1].zoom, zoom, "the fit was made for that display"); + app.run("view.setZoom", json!({"zoom": 100})).unwrap(); + take_window_ppi(&mut app, &ctx, ((uid, 1), false), win, &mut found(Some(crate::ScreenPpi::Read(Some(110.0))))); + assert!((inch(&app) - 127.0).abs() < 1e-9, "drawn in the main window, 100% counts from the main window's display: {}", inch(&app)); +} diff --git a/crates/ui-egui/src/panels/navigator.rs b/crates/ui-egui/src/panels/navigator.rs index 89df32b658..a41445ae80 100644 --- a/crates/ui-egui/src/panels/navigator.rs +++ b/crates/ui-egui/src/panels/navigator.rs @@ -437,6 +437,42 @@ mod tests { assert!(min.is_some_and(|m| (m - lo).abs() < 1e-6) && max.is_some_and(|m| (m - hi).abs() < 1e-6), "{min:?} to {max:?}"); } + /// A click on the thumbnail moves the view there and keeps the zoom percentage, here with + /// Display Print Size at 100% Zoom on a display of 127 points to an inch. + #[test] + fn a_click_on_the_thumbnail_keeps_the_zoom() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + app.canvas_rect = Some(Rect::from_min_size(pos2(0.0, 0.0), vec2(600.0, 400.0))); + app.run("view.setZoom", json!({"zoom": 250, "center": [200, 150]})).unwrap(); + let percent = |app: &VectorcraftApp| crate::state::zoom_display_percent(app.view().unwrap().zoom, app.print_ppi()); + let before = (app.view().unwrap().center, percent(&app)); + let ctx = egui::Context::default(); + let run = |app: &mut VectorcraftApp, events: Vec| { + let mut out = ctx.run_ui(egui::RawInput { events, ..Default::default() }, |ui| show(app, ui)); + out.textures_delta.clear(); + out + }; + let pasteboard = Tokens::get(&ctx).pasteboard; + let thumb = run(&mut app, vec![]) + .shapes + .iter() + .find_map(|c| match &c.shape { + egui::Shape::Rect(r) if r.fill == pasteboard => Some(r.rect), + _ => None, + }) + .expect("the thumbnail"); + let at = thumb.left_top() + thumb.size() * 0.25; + let button = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(&mut app, vec![egui::Event::PointerMoved(at)]); + run(&mut app, vec![button(true)]); + run(&mut app, vec![button(false)]); + assert_ne!(app.view().unwrap().center, before.0, "the click moved the view"); + assert!((percent(&app) - before.1).abs() < 1e-9, "and kept {}%: {}%", before.1, percent(&app)); + } + #[test] fn thumb_mapping_roundtrip() { let region = DRect::new(0.0, 0.0, 200.0, 100.0); diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 5a2681e7e7..751cd87584 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -54,6 +54,11 @@ pub struct View { /// percentage keeps its percentage then ([`crate::VectorcraftApp::settle_screen_ppi`]). #[serde(skip)] pub(crate) fit_zoom: Option, + /// The fit that gave [`Self::fit_zoom`] was made while the view's display was being read: the + /// view counts from the last reading meanwhile, and the reading, when it comes, leaves the zoom + /// alone while the view still has it. + #[serde(skip)] + pub(crate) fit_unread: bool, } impl Default for View { @@ -67,6 +72,7 @@ impl Default for View { outline: false, shown_ppi: None, fit_zoom: None, + fit_unread: false, } } } @@ -94,6 +100,7 @@ impl View { artboard: 0, outline: false, shown_ppi: None, + fit_unread: false, }) } diff --git a/docs/mcp.md b/docs/mcp.md index 8f48dde8d0..38640c6e77 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8288,13 +8288,17 @@ control channel's `ui.drag` scrubs), `showHomeScreen` (on by default: the Home s off, an empty window, and the Home button or `app.home` still shows the screen), `autoCollapseIconPanels` (off by default: on, a click away from a panel popped out of the icon column puts it away), `displayPrintSize` (on by default, also for saved preferences without the key: View › Actual Size / `view.actualSize` shows one document inch -in an inch of the display that shows the document's window, measured from the physical size macOS, Windows, X11 or -the Wayland compositor reports for that display. A document under the tabs counts from the main window's display, -and a document floating in an OS window of its own counts from that window's display. A window that moves to a -display of another density keeps its zoom percentage. Where the system reports no size, as on the web, or a size no -display has, an inch is 96 screen points. A view whose zoom counted from 96 points keeps its zoom when the first -measurement arrives. Off, 100% is one document point per screen point, and the desktop app does not measure the -displays. While it is on, `ui.inspect` gives `screenPpi`, the measured density of the main window's display, and +in an inch of the display that shows the document's window, measured from the physical size macOS, Windows, or on +Linux X11 or the Wayland compositor reports for that display. A document under the tabs counts from the main +window's display, and a document floating in an OS window of its own counts from that window's display. It also +applies in Pixel Preview. A window that moves to a display of another density keeps its zoom percentage. Where no +display is measured (the web build, the headless backend, `vectorcraft-cli`, and the desktop app on other systems), +where the system reports no size, or where it reports a size no display has, an inch is 96 screen points, so Actual +Size there shows 4/3 screen points per document point. When the first measurement of a display +arrives, a view that still has the zoom a fit or the document's saved view gave it keeps that zoom, and any other +view keeps its zoom percentage. Off, 100% is one document point per screen point, and the desktop app does not +measure the displays. While it is on, `ui.inspect` gives `screenPpi`, the measured density of the main window's +display, and `printPpi`, the points an inch takes at 100% in the current window; both are null while it is off). `uiScaling` scales the interface and not the art: a zoom shows the art at the same size at every UI Scaling. The tool shortcut preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f252db9314..e32dc77d7e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1292,7 +1292,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pen rubber band after a smooth anchor:** the preview segment to the pointer is the curve a click there adds, leaving the last anchor along its outgoing handle and arriving at the new corner anchor without a handle, so the segment keeps its shape when the anchor is placed, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/preview-paths-drawn.html) describes. Before, the preview was a different curve, and the segment changed shape at the click (#8296, in part; `pen::tests::rubber_band_is_the_segment_a_click_adds`); scores and estimates unchanged. - **Pen rubber band over an anchor a click ends on:** over the path's first anchor, the preview segment ends on that anchor, as the closing segment does; over an end of another open path, it ends on that end and arrives along the end's own handle, as the joining segment does. The preview picks these anchors at the pointer before snapping, as a press does. Before, the preview ended at the pointer and arrived without a handle, so the segment moved by up to the pick tolerance at the click, and changed shape when the other end was smooth (#8296, in part; the `pen_rubber_band` tests in `engine/tests/it`); scores and estimates unchanged. - The desktop app keeps the Color panel's Show Options or Hide Options between sessions, and `ui.colorPanel` sets its mode and options as its panel menu does. - - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (on by default, as [the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes; in VectorCraft, View › Actual Size shows one document inch in an inch of the display that shows the document's window, measured from the physical size the system reports for that display, or 96 screen points where it reports none; off, one document point per screen point; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). + - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (on by default, as [the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes; in VectorCraft, View › Actual Size shows one document inch in an inch of the display that shows the document's window, measured from the physical size the system reports for that display, or 96 screen points where it reports none; VectorCraft's own rules: a document in a floating window counts from that window's display, where the help page names only the primary monitor, and the preference also applies in Pixel Preview, which the help page leaves out; off, one document point per screen point; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). - Preferences › General › Scroll Sideways with Cmd/Ctrl + Wheel (on by default; dimmed while Zoom with Mouse Wheel is on): while Zoom with Mouse Wheel is off, Cmd/Ctrl with a mouse wheel's whole notches scrolls the canvas sideways instead of zooming. Alt + Cmd/Ctrl-wheel and a pinch on a Mac trackpad, on a touch screen or in the web build still zoom about the pointer, and once a trackpad gesture holds Alt, it zooms until it ends, also after Alt is let go. Under either wheel preference, Cmd/Ctrl with a touchpad zooms about the pointer. - Preferences › Type › Highlight Substituted Fonts (on by default) paints pink behind text drawn in a substitute for a missing font in every document, and turning it off removes that highlight everywhere (`prefs.set highlightSubstitutedFonts`); Document Setup keeps Highlight Substituted Glyphs ([help](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html)). - Preferences › User Interface › UI Scaling scales the interface ([help](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/modify-workspaces.html)). VectorCraft's own rule is that it leaves the art's size alone: at a given zoom a document point covers the same device pixels at every UI Scaling, so View › Actual Size shows the art at the same size whatever the UI Scaling. A click, a pinch or wheel zoom about the pointer, a pan, the Zoom tool's marquee, Fit, tiled panes, Pixel Preview and the Navigator's view box use the same mapping. Evidence: `canvas::tests_ui_scaling`, `tiled_documents_fit_their_panes_at_every_ui_scaling`, `the_view_box_outlines_the_canvas_at_every_ui_scaling`. Scores unchanged. From 1cecbb9aeedd66a24a47bda966f2983afba030fa Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 06:25:08 -0800 Subject: [PATCH 4/6] Display Print Size: keep the last density, fits and percentages right - A fit made while a floating window's display has not answered keeps counting from the density the window was last shown at, so Actual Size and the zoom field no longer fall back to 96 points to an inch meanwhile. - A view that still fits its floating window keeps fitting it after a move to a display of another density: the fit kept for the window takes the settled zoom. - The plausible range of a measured display applies to its pixels per inch, before the display scale divides them into points. A 1920 x 1080 display of 527 x 296 mm at scale 4 now measures about 23 points to an inch instead of falling back to 96, and Actual Size takes any finite, positive point density the host measured. - View > Set Zoom, Zoom In and Zoom Out, the wheel and the Zoom tool clear the zoom a fit gave the view, so a percentage that equals the last fit's zoom keeps its percentage at the first reading. - The Actual Size and preference descriptions say that a size no display has also counts 96 points to an inch. --- apps/vectorcraft/src/screen_density.rs | 24 ++++++--- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/app/view.rs | 10 +++- crates/ui-egui/src/canvas/tests.rs | 16 ++++++ crates/ui-egui/src/canvas/view.rs | 1 + crates/ui-egui/src/doc_windows.rs | 4 ++ crates/ui-egui/src/doc_windows/tests.rs | 50 +++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/gu.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/menus/run.rs | 3 ++ crates/ui-egui/src/menus/ui_commands.rs | 2 +- .../ui-egui/src/prefs_dialog/descriptions.rs | 2 +- crates/ui-egui/src/state.rs | 18 ++++--- docs/target-app-parity.md | 2 +- 40 files changed, 144 insertions(+), 46 deletions(-) diff --git a/apps/vectorcraft/src/screen_density.rs b/apps/vectorcraft/src/screen_density.rs index 70ba069684..4a8c91ec76 100644 --- a/apps/vectorcraft/src/screen_density.rs +++ b/apps/vectorcraft/src/screen_density.rs @@ -301,19 +301,20 @@ impl Tracker { /// The density, in points per inch, of a display `size` physical pixels wide and high, drawn at /// `scale` pixels to a point, that the system says is `mm` millimeters wide and high. `None` for a /// size that is no display's: zero or less, an aspect ratio given in place of the size (16 × 9, -/// 160 × 90 and the like), axes whose densities disagree in either orientation, or a density -/// outside [`vectorcraft_ui_egui::state::SCREEN_PPI_RANGE`]. A display turned a quarter turn may -/// report the size of its panel upright, so the axes are also tried swapped. +/// 160 × 90 and the like), axes whose densities disagree in either orientation, or a pixel density +/// outside [`vectorcraft_ui_egui::state::SCREEN_PPI_RANGE`]. The range applies to the pixels, before +/// the scale divides them into points. A display turned a quarter turn may report the size of its +/// panel upright, so the axes are also tried swapped. pub(crate) fn points_per_inch(size: PhysicalSize, scale: f64, mm: [f64; 2]) -> Option { if !(scale.is_finite() && scale > 0.0) || mm.iter().any(|v| !(v.is_finite() && *v > 0.0)) || aspect_as_size(mm) { return None; } - let points = [f64::from(size.width) / scale, f64::from(size.height) / scale]; - let density = |[w, h]: [f64; 2]| [points[0] / (w / MM_PER_INCH), points[1] / (h / MM_PER_INCH)]; + let pixels = [f64::from(size.width), f64::from(size.height)]; + let density = |[w, h]: [f64; 2]| [pixels[0] / (w / MM_PER_INCH), pixels[1] / (h / MM_PER_INCH)]; let agree = |[x, y]: [f64; 2]| (x - y).abs() <= AXES_AGREE * x.max(y); let [x, y] = [density(mm), density([mm[1], mm[0]])].into_iter().find(|d| agree(*d))?; let ppi = (x + y) / 2.0; - vectorcraft_ui_egui::state::SCREEN_PPI_RANGE.contains(&ppi).then_some(ppi) + vectorcraft_ui_egui::state::SCREEN_PPI_RANGE.contains(&ppi).then_some(ppi / scale) } /// Whether `mm` is an aspect ratio that a display's EDID gave in place of its size: 16:9, 16:10 @@ -545,6 +546,17 @@ mod tests { assert_eq!(points_per_inch(PhysicalSize::new(7680, 4320), 1.0, [53.0, 30.0]), None, "over it"); } + /// The range applies to the display's pixels: a 1920 × 1080 display of 527 × 296 mm drawn at + /// scale 4 has about 23 points to an inch, which is a real density. + #[test] + fn a_large_scale_factor_does_not_put_a_display_out_of_range() { + let ppi = points_per_inch(PhysicalSize::new(1920, 1080), 4.0, [527.0, 296.0]); + let pixels = points_per_inch(PhysicalSize::new(1920, 1080), 1.0, [527.0, 296.0]).unwrap_or(0.0); + assert!(ppi.is_some_and(|p| p < 30.0 && (p - pixels / 4.0).abs() < 1e-9), "{ppi:?}"); + let print = vectorcraft_ui_egui::state::print_ppi(true, ppi); + assert_eq!(print, ppi, "Actual Size counts from it, not from 96"); + } + /// A 1920 × 1080 display at scale 1 and position `x`, named `name`. fn display(name: &str, x: i32) -> Display { Display { diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 55b0df872e..7a18fcf475 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -484,7 +484,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "view.actualSize", "Actual Size", "Cmd+1", - "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none; the same at every UI Scaling", + "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none or a size no display has; the same at every UI Scaling", ), ("view.setZoom", "Set Zoom", "", "{zoom: percent, center?: [x,y]}"), ( diff --git a/crates/ui-egui/src/app/view.rs b/crates/ui-egui/src/app/view.rs index f20ad4758f..8498732365 100644 --- a/crates/ui-egui/src/app/view.rs +++ b/crates/ui-egui/src/app/view.rs @@ -191,8 +191,14 @@ impl VectorcraftApp { } if !keep { // While the display is being read, the fit counts from the last reading, as the other - // views there do, and the reading keeps its zoom. - v.shown_ppi = Some(now); + // views there do, and the reading keeps its zoom. A floating window whose display has + // not answered keeps counting from the density it was last shown at. + match now { + crate::ScreenPpi::Unread => { + v.shown_ppi.get_or_insert(now); + } + read => v.shown_ppi = Some(read), + } v.fit_unread = reading == crate::ScreenPpi::Unread; return; } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 2576980464..0314401506 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -8674,6 +8674,22 @@ fn actual_size_after_a_fit_of_the_same_zoom_stays_at_100_percent() { assert!((now - shown).abs() < 1e-9, "a zoom chosen after the fit keeps its percentage: {shown} → {now}"); } +/// A percentage set with `view.setZoom` keeps its percentage at the first reading, also when it +/// gives the view the zoom of the fit made before it. +#[test] +fn a_set_zoom_of_the_fits_zoom_keeps_its_percentage_at_the_first_reading() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 300, "height": 100})).unwrap(); + app.canvas_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(460.0, 260.0))); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.run("view.fitArtboard", json!({})).unwrap(); + let fitted = app.view().unwrap().zoom; + app.run("view.setZoom", json!({"zoom": 100})).unwrap(); + assert_eq!(app.view().unwrap().zoom, fitted, "100% has the fit's zoom before any reading"); + assert!(app.set_screen_ppi(Some(127.0))); + assert!((app.view().unwrap().zoom * 72.0 - 127.0).abs() < 1e-9, "the reading keeps 100%: {}", app.view().unwrap().zoom * 72.0); +} + /// Fit Artboard in Window fits the artboard as a rotated view shows it: at 45° every corner is /// on the canvas and one is within the 30-point margin of an edge. At 0° the zoom is unchanged. #[test] diff --git a/crates/ui-egui/src/canvas/view.rs b/crates/ui-egui/src/canvas/view.rs index b2714f2645..9dd5c3b974 100644 --- a/crates/ui-egui/src/canvas/view.rs +++ b/crates/ui-egui/src/canvas/view.rs @@ -123,6 +123,7 @@ pub(crate) fn actual_size_zoom(print: Option) -> f64 { pub(super) fn zoom_about(vm: &mut View, rect: egui::Rect, p: Pos2, zoom: f64, ui_zoom: f32) { let before = Xf::at(rect, vm, ui_zoom).to_doc(p); vm.zoom = zoom.clamp(0.0313, 640.0); + vm.fit_zoom = None; vm.center += before - Xf::at(rect, vm, ui_zoom).to_doc(p); } diff --git a/crates/ui-egui/src/doc_windows.rs b/crates/ui-egui/src/doc_windows.rs index f565fcb4a8..058132f839 100644 --- a/crates/ui-egui/src/doc_windows.rs +++ b/crates/ui-egui/src/doc_windows.rs @@ -650,6 +650,10 @@ fn take_window_ppi(app: &mut VectorcraftApp, ctx: &egui::Context, ((uid, number) let size = shown.body.map(|b| b.size()); let following = view(app, win).is_some_and(|v| v.fitted && shown.fit.is_some_and(|(s, z, c)| Some(s) == size && z == v.zoom && c == v.center)); app.settle_window_ppi(win, !(following && (first || fitted_now))); + // A view that still fits its window keeps fitting it at the zoom the new density gave it. + if following && let (Some((s, _, _)), Some(v)) = (shown.fit, view(app, win)) { + shown.fit = Some((s, v.zoom, v.center)); + } ctx.request_repaint(); } diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index 8a001a3748..fb803249e1 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -1331,3 +1331,53 @@ fn a_floating_os_window_takes_the_density_of_the_display_it_is_found_on() { take_window_ppi(&mut app, &ctx, ((uid, 1), false), win, &mut found(Some(crate::ScreenPpi::Read(Some(110.0))))); assert!((inch(&app) - 127.0).abs() < 1e-9, "drawn in the main window, 100% counts from the main window's display: {}", inch(&app)); } + +/// A fit made while a floating OS window is off every display keeps counting from the density the +/// window was last shown at, and the reading that follows leaves the fit's zoom alone. +#[test] +fn a_fit_made_while_a_floating_window_is_unread_counts_from_its_last_reading() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let uid = app.session.documents()[1].uid; + let win = (1, 1); + let found = |ppi: Option| Shown { ppi, ..Default::default() }; + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(Some(crate::ScreenPpi::Read(Some(150.0))))); + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(None)); + app.run("view.fitArtboard", json!({})).unwrap(); + let zoom = app.views[1].zoom; + assert_eq!(app.print_ppi_of(Some(win)), Some(150.0), "the fit counts from the last reading"); + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut found(Some(crate::ScreenPpi::Read(Some(110.0))))); + assert_eq!(app.views[1].zoom, zoom, "the reading leaves the fit alone"); + assert_eq!(app.print_ppi_of(Some(win)), Some(110.0)); +} + +/// A floating OS window whose view still fits it, moved between two displays read before, keeps +/// fitting it at the zoom the new density gives: the fit this frame keeps is the settled one. +#[test] +fn a_fitted_floating_window_moved_to_another_density_keeps_fitting() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let uid = app.session.documents()[1].uid; + let win = (1, 1); + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut Shown { ppi: Some(crate::ScreenPpi::Read(Some(91.0))), ..Default::default() }); + app.run("view.fitArtboard", json!({})).unwrap(); + let (zoom, center) = (app.views[1].zoom, app.views[1].center); + let body = egui::Rect::from_min_size(Pos2::ZERO, vec2(500.0, 400.0)); + let fit = Some((body.size(), zoom, center)); + if let Some(x) = app.ui.floating.iter_mut().find(|x| x.uid == uid && x.view == 1) { + x.fit = fit; + } + let mut moved = Shown { ppi: Some(crate::ScreenPpi::Read(Some(150.0))), body: Some(body), fit, ..Default::default() }; + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut moved); + let v = app.views[1]; + assert_ne!(v.zoom, zoom, "the move to a denser display keeps the zoom percentage"); + assert_eq!(moved.fit, Some((body.size(), v.zoom, v.center)), "and the fit kept is the settled zoom"); +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a547a5de48..1dc78ac049 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3209,7 +3209,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. „Селекция › Същото › Цвят на запълване“, „Цвят на щриха“ и „Запълване и щрих“ намират само същия нюанс на глобална или плътна мостра, а не всеки неин нюанс. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показва началния екран, когато няма отворен документ; ако е изключено, прозорецът остава празен, докато не щракнете „Начало“. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Измерва обектите заедно с щрихите и ефектите, които променят формата, за размер, позиция и подравняване; сенките, сиянията и замъгляванията не се измерват. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. При мащаб 100 % един инч от документа запълва един инч от дисплея или 96 екранни точки, когато системата не съобщава размера на дисплея. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. При мащаб 100 % един инч от документа запълва един инч от дисплея или 96 екранни точки, когато системата не съобщава използваем размер на дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Двойно щракване върху група, контур или изображение с инструмента „Селекция“ ги отваря в режим на изолация. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Запълванията и щрихите с мостра се трансформират заедно с графиката, освен ако трансформацията или менюто на панела „Трансформиране“ не избере друго. Live corner radii scale with the art, unless the scale chooses otherwise. Радиусите на динамичните ъгли се мащабират заедно с графиката, освен ако мащабирането не избере друго. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 9204190552..87484221a8 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4696,7 +4696,7 @@ font-technology Variable Varijabilni Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Odabir › Isto › Boja ispune, Boja poteza i Ispuna i potez pronalaze samo istu nijansu globalnog ili spot uzorka, a ne bilo koju njegovu nijansu. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Prikazuje početni ekran kada nijedan dokument nije otvoren; kada je isključeno, prozor ostaje prazan dok ne kliknete Početna. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mjeri objekte zajedno s potezima i efektima koji mijenjaju oblik za veličinu, položaj i poravnanje; sjene, sjaj i zamućenja se ne mjere. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Pri zumu od 100% jedan inč dokumenta ispunjava jedan inč ekrana, ili 96 tačaka ekrana kada sistem ne javlja veličinu ekrana. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Pri zumu od 100% jedan inč dokumenta ispunjava jedan inč ekrana, ili 96 tačaka ekrana kada sistem ne javlja upotrebljivu veličinu ekrana. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dvostruki klik na grupu, putanju ili sliku alatom Odabir otvara ih u načinu izolacije. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Ispune i potezi s uzorkom transformišu se zajedno s grafikom, osim ako transformacija ili meni panela Transformiši ne odabere drugačije. Live corner radii scale with the art, unless the scale chooses otherwise. Poluprečnici dinamičnih uglova skaliraju se zajedno s grafikom, osim ako skaliranje ne odabere drugačije. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index d9fe0a739a..b3ad7e42d6 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4067,7 +4067,7 @@ digits Malayalam Malaiàlam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selecció › Igual › Color de farciment, Color del traç i Farciment i traç només coincideixen amb el mateix matís d’una mostra global o de tinta plana, no amb qualsevol matís seu. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra la pantalla d’inici quan no hi ha cap document obert; desactivada, la finestra queda buida fins que feu clic a Inici. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mesura els objectes amb els traços i els efectes que en canvien la forma per a la mida, la posició i l’alineació; les ombres, les lluïsors i els desenfocaments no es mesuren. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Amb un zoom del 100 %, una polzada del document omple una polzada de la pantalla, o 96 punts de pantalla quan el sistema no n’indica la mida. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Amb un zoom del 100 %, una polzada del document omple una polzada de la pantalla, o 96 punts de pantalla quan el sistema no n’indica una mida utilitzable. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Fer doble clic en un grup, traçat o imatge amb l’eina Selecció l’obre en mode d’aïllament. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Els farciments i traços de motiu es transformen amb la il·lustració, tret que una transformació o el menú del panell Transforma triï una altra cosa. Live corner radii scale with the art, unless the scale chooses otherwise. Els radis de cantonada dinàmics s’escalen amb la il·lustració, tret que l’escalat triï una altra cosa. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index bb1e2f34ab..bd96fc2da4 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4805,7 +4805,7 @@ font-technology Variable Variabilní Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Výběr › Stejné › Barva výplně, Barva tahu a Výplň a tah najdou jen stejný odstín globálního nebo přímého vzorku, ne libovolný jeho odstín. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Zobrazí domovskou obrazovku, když není otevřený žádný dokument; když je vypnuto, okno zůstane prázdné, dokud neklepnete na Domů. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Měří objekty včetně tahů a efektů měnících tvar pro velikost, polohu a zarovnání; stíny, záře a rozostření se neměří. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Při zvětšení 100 % vyplní jeden palec dokumentu jeden palec displeje, nebo 96 obrazovkových bodů, pokud systém velikost displeje neudává. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Při zvětšení 100 % vyplní jeden palec dokumentu jeden palec displeje, nebo 96 obrazovkových bodů, pokud systém neudává použitelnou velikost displeje. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Poklepání na skupinu, cestu nebo obraz nástrojem Výběr je otevře v izolačním režimu. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Výplně a tahy se vzorkem se transformují s kresbou, pokud transformace nebo nabídka panelu Transformace nezvolí jinak. Live corner radii scale with the art, unless the scale chooses otherwise. Poloměry živých rohů se mění s velikostí kresby, pokud změna velikosti nezvolí jinak. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index d3978bfddf..6d0be9adb7 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7253,7 +7253,7 @@ font-technology Variable Variable Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Markér › Samme › Fyldfarve, Stregfarve og Fyld og streg finder kun samme nuance af en global farveprøve eller staffagefarve, ikke en hvilken som helst nuance af den. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Viser startskærmen, når intet dokument er åbent; når den er slået fra, forbliver vinduet tomt, indtil du klikker på Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Måler objekter med deres streger og formændrende effekter til størrelse, position og justering; skygger, glød og sløringer måles ikke. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Ved 100 % zoom fylder en tomme af dokumentet en tomme af skærmen, eller 96 skærmpunkter, hvis systemet ikke oplyser skærmens størrelse. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Ved 100 % zoom fylder en tomme af dokumentet en tomme af skærmen, eller 96 skærmpunkter, hvis systemet ikke oplyser en brugbar skærmstørrelse. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dobbeltklik på en gruppe, en sti eller et billede med værktøjet Markering åbner det i isolationstilstand. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Mønsterfyld og -streger transformeres med grafikken, medmindre en transformation eller menuen i panelet Transformér vælger andet. Live corner radii scale with the art, unless the scale chooses otherwise. Live-hjørneradier skaleres med grafikken, medmindre skaleringen vælger andet. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2663967128..002798227c 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3279,7 +3279,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. „Auswahl › Gleich › Flächenfarbe“, „Konturfarbe“ und „Fläche und Kontur“ finden nur denselben Farbton eines globalen oder Volltonfarbfelds, nicht jeden Farbton davon. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Zeigt den Startbildschirm, wenn kein Dokument geöffnet ist; ist die Option aus, bleibt das Fenster leer, bis Sie auf „Start“ klicken. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Misst Objekte für Größe, Position und Ausrichtung mit ihren Konturen und formverändernden Effekten; Schatten, Schein und Weichzeichnungen werden nicht gemessen. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Bei 100 % Zoom füllt ein Zoll des Dokuments einen Zoll des Bildschirms, oder 96 Bildschirmpunkte, wenn das System keine Bildschirmgröße meldet. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Bei 100 % Zoom füllt ein Zoll des Dokuments einen Zoll des Bildschirms, oder 96 Bildschirmpunkte, wenn das System keine verwendbare Bildschirmgröße meldet. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ein Doppelklick mit dem Auswahl-Werkzeug auf eine Gruppe, einen Pfad oder ein Bild öffnet sie im Isolationsmodus. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Musterflächen und -konturen werden mit dem Bildmaterial transformiert, sofern die Transformation oder das Menü des Bedienfelds „Transformieren“ nichts anderes wählt. Live corner radii scale with the art, unless the scale chooses otherwise. Live-Eckenradien skalieren mit dem Bildmaterial, sofern die Skalierung nichts anderes wählt. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 579174fce7..cbd3f5c92b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4132,7 +4132,7 @@ digits Malayalam Μαλαγιάλαμ Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Τα Επιλογή › Ίδιο › Χρώμα γεμίσματος, Χρώμα περιγράμματος και Γέμισμα και περίγραμμα βρίσκουν μόνο την ίδια απόχρωση ενός καθολικού ή σημειακού δείγματος, όχι οποιαδήποτε απόχρωσή του. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Εμφανίζει την αρχική οθόνη όταν δεν είναι ανοιχτό κανένα έγγραφο· όταν είναι ανενεργό, το παράθυρο μένει κενό μέχρι να κάνετε κλικ στην Αρχική οθόνη. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Μετρά τα αντικείμενα μαζί με τα περιγράμματα και τα εφέ που αλλάζουν το σχήμα τους για μέγεθος, θέση και στοίχιση· οι σκιές, οι λάμψεις και οι θολώσεις δεν μετρώνται. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Σε ζουμ 100%, μία ίντσα του εγγράφου γεμίζει μία ίντσα της οθόνης, ή 96 στιγμές οθόνης όταν το σύστημα δεν αναφέρει το μέγεθος της οθόνης. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Σε ζουμ 100%, μία ίντσα του εγγράφου γεμίζει μία ίντσα της οθόνης, ή 96 στιγμές οθόνης όταν το σύστημα δεν αναφέρει χρησιμοποιήσιμο μέγεθος οθόνης. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Το διπλό κλικ σε ομάδα, διαδρομή ή εικόνα με το εργαλείο Επιλογή την ανοίγει σε λειτουργία απομόνωσης. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Τα γεμίσματα και τα περιγράμματα μοτίβου μετασχηματίζονται μαζί με το γραφικό, εκτός αν ένας μετασχηματισμός ή το μενού του πλαισίου Μετασχηματισμός επιλέξει κάτι άλλο. Live corner radii scale with the art, unless the scale chooses otherwise. Οι ακτίνες των δυναμικών γωνιών κλιμακώνονται μαζί με το γραφικό, εκτός αν η κλιμάκωση επιλέξει κάτι άλλο. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 08b4fc2693..94fe1524c4 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3315,7 +3315,7 @@ digits Malayalam Malayálam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selección › Igual › Color de relleno, Color de trazo y Relleno y trazo solo coinciden con el mismo matiz de una muestra global o de tinta plana, no con cualquier matiz de ella. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Muestra la pantalla de inicio cuando no hay ningún documento abierto; desactivada, la ventana queda vacía hasta que hace clic en Inicio. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mide los objetos con sus trazos y los efectos que cambian su forma para el tamaño, la posición y la alineación; las sombras, los resplandores y los desenfoques no se miden. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Con un zoom del 100 %, una pulgada del documento ocupa una pulgada de la pantalla, o 96 puntos de pantalla si el sistema no indica su tamaño. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Con un zoom del 100 %, una pulgada del documento ocupa una pulgada de la pantalla, o 96 puntos de pantalla si el sistema no indica un tamaño utilizable. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Al hacer doble clic en un grupo, trazado o imagen con la herramienta Selección, se abre en modo de aislamiento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Los rellenos y trazos de motivo se transforman con la ilustración, salvo que una transformación o el menú del panel Transformar indique otra cosa. Live corner radii scale with the art, unless the scale chooses otherwise. Los radios de esquina dinámicos se escalan con la ilustración, salvo que el escalado indique otra cosa. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c712366c71..037d3a5f40 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4715,7 +4715,7 @@ font-technology Variable Muuttuvat Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Valinta › Sama › Täyttöväri, Viivan väri sekä Täyttö ja viiva löytävät vain globaalin tai spottivärimallin saman sävyn, eivät mitä tahansa sen sävyä. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Näyttää aloitusnäytön, kun yhtään asiakirjaa ei ole auki; kun asetus ei ole käytössä, ikkuna pysyy tyhjänä, kunnes napsautat Aloitus. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mittaa objektit viivoineen ja muotoa muuttavine tehosteineen kokoa, sijaintia ja tasausta varten; varjoja, hehkuja ja sumennuksia ei mitata. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100 %:n zoomauksella asiakirjan tuuma täyttää näytön tuuman, tai 96 näyttöpistettä, jos järjestelmä ei ilmoita näytön kokoa. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100 %:n zoomauksella asiakirjan tuuma täyttää näytön tuuman, tai 96 näyttöpistettä, jos järjestelmä ei ilmoita käyttökelpoista näytön kokoa. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ryhmän, polun tai kuvan kaksoisnapsautus Valinta-työkalulla avaa sen eristystilaan. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Kuviotäytöt ja -viivat muuntuvat grafiikan mukana, ellei muunnos tai Muunna-paneelin valikko valitse toisin. Live corner radii scale with the art, unless the scale chooses otherwise. Dynaamisten kulmien säteet skaalautuvat grafiikan mukana, ellei skaalaus valitse toisin. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 384add6e6f..46dea97980 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3303,7 +3303,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Sélection › Identique › Couleur de fond, Couleur du contour et Fond et contour ne retiennent que la même teinte d’une nuance globale ou d’une couleur d’accompagnement, et non toutes ses teintes. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Affiche l’écran d’accueil quand aucun document n’est ouvert. Désactivée, la fenêtre reste vide jusqu’à ce que vous cliquiez sur Accueil. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mesure les objets avec leurs contours et leurs effets qui modifient la forme pour la taille, la position et l’alignement. Les ombres, lueurs et flous ne sont pas mesurés. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. À 100 % de zoom, un pouce du document occupe un pouce de l’écran, ou 96 points d’écran si le système n’indique pas la taille de l’écran. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. À 100 % de zoom, un pouce du document occupe un pouce de l’écran, ou 96 points d’écran si le système n’indique pas de taille d’écran utilisable. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Un double-clic sur un groupe, un tracé ou une image avec l’outil Sélection l’ouvre en mode Isolation. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Les fonds et contours de motif se transforment avec l’illustration, sauf si une transformation ou le menu du panneau Transformation en décide autrement. Live corner radii scale with the art, unless the scale chooses otherwise. Les rayons d’angle dynamiques se mettent à l’échelle avec l’illustration, sauf si la mise à l’échelle en décide autrement. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c9b4e617f7..815b4668ab 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3370,7 +3370,7 @@ arrowhead Feather પીંછું Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. પસંદ કરો › સમાન › ભરવાનો રંગ, સ્ટ્રોક રંગ અને ભરો અને સ્ટ્રોક ફક્ત ગ્લોબલ કે સ્પોટ સ્વૉચના એ જ ટિન્ટ સાથે મેળ ખાય છે, તેના કોઈપણ ટિન્ટ સાથે નહીં. Shows the Home screen when no document is open; off, the window stays empty until you click Home. કોઈ દસ્તાવેજ ખુલ્લો ન હોય ત્યારે હોમ સ્ક્રીન બતાવે છે; બંધ હોય ત્યારે તમે હોમ પર ક્લિક ન કરો ત્યાં સુધી વિન્ડો ખાલી રહે છે. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. કદ, સ્થાન અને ગોઠવણી માટે ઑબ્જેક્ટને તેમના સ્ટ્રોક અને આકાર બદલતી ઇફેક્ટ્સ સાથે માપે છે; છાયા, ગ્લો અને બ્લર માપવામાં આવતા નથી. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% ઝૂમ પર દસ્તાવેજનો એક ઇંચ ડિસ્પ્લેનો એક ઇંચ ભરે છે, અથવા સિસ્ટમ ડિસ્પ્લેનું કદ ન જણાવે ત્યારે 96 સ્ક્રીન પોઇન્ટ લે છે. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100% ઝૂમ પર દસ્તાવેજનો એક ઇંચ ડિસ્પ્લેનો એક ઇંચ ભરે છે, અથવા સિસ્ટમ ડિસ્પ્લેનું ઉપયોગી કદ ન જણાવે ત્યારે 96 સ્ક્રીન પોઇન્ટ લે છે. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. પસંદગી ટૂલથી ગ્રુપ, પાથ કે છબી પર ડબલ-ક્લિક કરવાથી તે આઇસોલેશન મોડમાં ખુલે છે. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. પૅટર્ન ભરણ અને સ્ટ્રોક આર્ટવર્ક સાથે ટ્રાન્સફોર્મ થાય છે, સિવાય કે કોઈ ટ્રાન્સફોર્મ કે ટ્રાન્સફોર્મ પેનલનું મેનૂ બીજું પસંદ કરે. Live corner radii scale with the art, unless the scale chooses otherwise. લાઇવ ખૂણાઓની ત્રિજ્યાઓ આર્ટવર્ક સાથે સ્કેલ થાય છે, સિવાય કે સ્કેલિંગ બીજું પસંદ કરે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 4f875c707c..5eba3a7548 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4698,7 +4698,7 @@ arrowhead Feather पंख Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. सिलेक्ट › समान › फ़िल रंग, स्ट्रोक रंग और फ़िल व स्ट्रोक केवल ग्लोबल या स्पॉट स्वॉच के उसी टिंट से मेल खाते हैं, उसके किसी भी टिंट से नहीं। Shows the Home screen when no document is open; off, the window stays empty until you click Home. कोई डॉक्यूमेंट खुला न होने पर होम स्क्रीन दिखाता है; बंद होने पर विंडो तब तक खाली रहती है जब तक आप होम पर क्लिक नहीं करते। Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. साइज़, स्थिति और संरेखण के लिए ऑब्जेक्ट को उनके स्ट्रोक और आकार बदलने वाले इफ़ेक्ट के साथ मापता है; छाया, ग्लो और ब्लर नहीं मापे जाते। - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% ज़ूम पर डॉक्यूमेंट का एक इंच डिस्प्ले का एक इंच घेरता है, या सिस्टम डिस्प्ले का आकार न बताए तो 96 स्क्रीन पॉइंट लेता है। + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100% ज़ूम पर डॉक्यूमेंट का एक इंच डिस्प्ले का एक इंच घेरता है, या सिस्टम डिस्प्ले का उपयोग योग्य आकार न बताए तो 96 स्क्रीन पॉइंट लेता है। Double-clicking a group, path or image with the Selection tool opens it in isolation mode. सिलेक्शन टूल से किसी ग्रुप, पाथ या इमेज पर डबल-क्लिक करने से वह आइसोलेशन मोड में खुलता है। Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. पैटर्न वाले फ़िल और स्ट्रोक आर्टवर्क के साथ रूपांतरित होते हैं, जब तक कोई रूपांतरण या रूपांतरण पैनल का मेनू कुछ और न चुने। Live corner radii scale with the art, unless the scale chooses otherwise. लाइव कोनों की त्रिज्याएँ आर्टवर्क के साथ स्केल होती हैं, जब तक स्केलिंग कुछ और न चुने। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index d14fb0bced..f6b4d33442 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3903,7 +3903,7 @@ mark-style Japanese Japán Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. A Kijelölés › Azonos › Kitöltőszín, Körvonalszín és Kitöltés és körvonal csak egy globális vagy direkt színminta azonos árnyalatát találja meg, nem bármely árnyalatát. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Megjeleníti a kezdőképernyőt, ha nincs megnyitott dokumentum; kikapcsolva az ablak üres marad, amíg a Kezdőképernyő gombra nem kattint. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Az objektumokat körvonalaikkal és alakmódosító effektusaikkal együtt méri a mérethez, a pozícióhoz és az igazításhoz; az árnyékokat, ragyogásokat és elmosásokat nem méri. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100%-os nagyításnál a dokumentum egy hüvelyke a kijelző egy hüvelykét tölti ki, vagy 96 képernyőpontot, ha a rendszer nem adja meg a kijelző méretét. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100%-os nagyításnál a dokumentum egy hüvelyke a kijelző egy hüvelykét tölti ki, vagy 96 képernyőpontot, ha a rendszer nem ad meg használható kijelzőméretet. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Ha a Kijelölés eszközzel duplán kattint egy csoportra, útvonalra vagy képre, az elkülönítő módban nyílik meg. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. A mintázatos kitöltések és körvonalak a grafikával együtt alakulnak át, hacsak egy átalakítás vagy az Átalakítás panel menüje mást nem választ. Live corner radii scale with the art, unless the scale chooses otherwise. Az élő sarkok sugara a grafikával együtt méreteződik, hacsak a méretezés mást nem választ. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index ec6c655037..e389d8b129 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5119,7 +5119,7 @@ font-technology Variable Variabel Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seleksi › Sama › Warna isian, Warna stroke, dan Isian & stroke hanya mencocokkan tint yang sama dari swatch global atau spot, bukan sembarang tint-nya. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Menampilkan layar Home saat tidak ada dokumen yang terbuka; saat nonaktif, jendela tetap kosong sampai Anda mengklik Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mengukur objek beserta stroke dan efek yang mengubah bentuknya untuk ukuran, posisi, dan perataan; bayangan, cahaya, dan kekaburan tidak diukur. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Pada zum 100%, satu inci dokumen mengisi satu inci layar, atau 96 titik layar bila sistem tidak melaporkan ukuran layar. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Pada zum 100%, satu inci dokumen mengisi satu inci layar, atau 96 titik layar bila sistem tidak melaporkan ukuran layar yang dapat dipakai. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Mengklik ganda grup, jalur, atau gambar dengan alat Seleksi membukanya dalam mode isolasi. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Isian dan stroke pola ikut bertransformasi dengan karya seni, kecuali transformasi atau menu panel Transformasi memilih lain. Live corner radii scale with the art, unless the scale chooses otherwise. Radius sudut dinamis ikut diskalakan dengan karya seni, kecuali penskalaan memilih lain. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 451efa2381..86c8940d87 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3364,7 +3364,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selezione › Uguale › Colore riempimento, Colore traccia e Riempimento e traccia trovano solo la stessa tinta di un campione globale o di un colore spot, non qualsiasi sua tinta. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra la schermata Home quando nessun documento è aperto; se disattivata, la finestra resta vuota finché non fai clic su Home. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Misura gli oggetti con le tracce e gli effetti che ne cambiano la forma per dimensioni, posizione e allineamento; ombre, bagliori e sfocature non vengono misurati. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Allo zoom del 100%, un pollice del documento occupa un pollice dello schermo, o 96 punti dello schermo se il sistema non ne indica le dimensioni. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Allo zoom del 100%, un pollice del documento occupa un pollice dello schermo, o 96 punti dello schermo se il sistema non ne indica dimensioni utilizzabili. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Un doppio clic su un gruppo, un tracciato o un'immagine con lo strumento Selezione lo apre in modalità isolamento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. I riempimenti e le tracce con motivo si trasformano con la grafica, a meno che una trasformazione o il menu del pannello Trasforma scelga diversamente. Live corner radii scale with the art, unless the scale chooses otherwise. I raggi degli angoli dinamici si ridimensionano con la grafica, a meno che il ridimensionamento scelga diversamente. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index e1e9cf8bc4..cead28c43e 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3332,7 +3332,7 @@ mark-style Japanese 日本式 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 選択 › 共通 › カラー (塗り)、カラー (線)、塗りと線は、グローバルスウォッチまたは特色スウォッチの同じ濃度だけを選び、ほかの濃度は選びません。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. ドキュメントが開いていないときにホーム画面を表示します。オフのときは、ホームをクリックするまでウィンドウは空のままです。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. サイズ、位置、整列のために、線と形を変える効果を含めてオブジェクトを測ります。ドロップシャドウ、光彩、ぼかしは含めません。 - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% 表示のとき、ドキュメントの 1 インチをディスプレイの 1 インチで表示します。システムがディスプレイのサイズを報告しない場合は 96 スクリーンポイントで表示します。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100% 表示のとき、ドキュメントの 1 インチをディスプレイの 1 インチで表示します。システムが使用できるディスプレイのサイズを報告しない場合は 96 スクリーンポイントで表示します。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 選択ツールでグループ、パス、画像をダブルクリックすると、編集モードで開きます。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 変形コマンドや変形パネルのメニューで別の指定をしない限り、パターンの塗りと線をアートワークと一緒に変形します。 Live corner radii scale with the art, unless the scale chooses otherwise. 拡大・縮小で別の指定をしない限り、ライブコーナーの半径をアートワークと一緒に拡大・縮小します。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 513b6ff533..ee4e1da69d 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6506,7 +6506,7 @@ font-technology Variable ცვლადი Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. მონიშვნა › იგივე › შევსების ფერი, კონტურის ფერი და შევსება და კონტური პოულობს გლობალური ან სპოტ-ფერის ნიმუშის მხოლოდ იმავე ტონირებას და არა მის ნებისმიერ ტონირებას. Shows the Home screen when no document is open; off, the window stays empty until you click Home. აჩვენებს საწყის ეკრანს, როცა არცერთი დოკუმენტი არ არის გახსნილი; გამორთვისას ფანჯარა ცარიელი რჩება, „საწყის ეკრანზე“ დაწკაპუნებამდე. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. ზომის, პოზიციისა და სწორების დროს ობიექტებს ზომავს კონტურებითა და ფორმის შემცვლელი ეფექტებით; ჩრდილები, ნათება და გაბუნდოვნება არ იზომება. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100%-იან მასშტაბზე დოკუმენტის ერთი დუიმი ეკრანის ერთ დუიმს ავსებს, ან 96 ეკრანის პუნქტს, როცა სისტემა ეკრანის ზომას არ აცნობებს. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100%-იან მასშტაბზე დოკუმენტის ერთი დუიმი ეკრანის ერთ დუიმს ავსებს, ან 96 ეკრანის პუნქტს, როცა სისტემა ეკრანის გამოსადეგ ზომას არ აცნობებს. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. მონიშვნის ხელსაწყოთი ჯგუფზე, ტრაექტორიაზე ან გამოსახულებაზე ორჯერ დაწკაპუნება მას იზოლაციის რეჟიმში ხსნის. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. პატერნის შევსებები და კონტურები ნახატთან ერთად გარდაიქმნება, თუ გარდაქმნა ან გარდაქმნის პანელის მენიუ სხვას არ აირჩევს. Live corner radii scale with the art, unless the scale chooses otherwise. ცოცხალი კუთხეების რადიუსები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 84e309e056..ccff8c99f0 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3321,7 +3321,7 @@ mark-style Japanese 일본식 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 선택 › 동일 › 칠 색상, 선 색상, 칠 및 선은 전역 또는 별색 견본의 같은 색조만 찾고, 다른 색조는 찾지 않습니다. Shows the Home screen when no document is open; off, the window stays empty until you click Home. 열린 문서가 없을 때 홈 화면을 표시합니다. 끄면 홈을 클릭할 때까지 창이 비어 있습니다. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 크기, 위치, 정렬을 위해 선과 모양을 바꾸는 효과를 포함하여 개체를 측정합니다. 그림자, 광선, 흐림 효과는 측정하지 않습니다. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 100% 확대/축소에서 문서의 1인치가 디스플레이의 1인치를 채우며, 시스템이 디스플레이 크기를 알려 주지 않으면 96 화면 포인트를 차지합니다. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 100% 확대/축소에서 문서의 1인치가 디스플레이의 1인치를 채우며, 시스템이 사용할 수 있는 디스플레이 크기를 알려 주지 않으면 96 화면 포인트를 차지합니다. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 선택 도구로 그룹, 패스 또는 이미지를 두 번 클릭하면 격리 모드로 엽니다. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 변형 명령이나 변형 패널의 메뉴에서 달리 선택하지 않는 한, 패턴 칠과 선이 아트웍과 함께 변형됩니다. Live corner radii scale with the art, unless the scale chooses otherwise. 크기 조정에서 달리 선택하지 않는 한, 라이브 모퉁이 반지름이 아트웍과 함께 크기 조정됩니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 4dbafaa5a5..4f957f65a4 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5119,7 +5119,7 @@ font-technology Variable Variabel Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Selecteren › Zelfde › Vulkleur, Contourkleur en Vulling en contour vinden alleen dezelfde tint van een globaal of steunkleurstaal, niet elke tint ervan. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Toont het startscherm wanneer er geen document open is; uitgeschakeld blijft het venster leeg totdat u op Home klikt. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Meet objecten met hun contouren en vormveranderende effecten voor grootte, positie en uitlijning; schaduwen, gloed en vervagingen worden niet gemeten. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Bij 100% zoom vult één inch van het document één inch van het scherm, of 96 schermpunten als het systeem geen schermgrootte doorgeeft. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Bij 100% zoom vult één inch van het document één inch van het scherm, of 96 schermpunten als het systeem geen bruikbare schermgrootte doorgeeft. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dubbelklikken op een groep, pad of afbeelding met het gereedschap Selectie opent die in de isolatiemodus. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Patroonvullingen en -contouren transformeren mee met de illustratie, tenzij een transformatie of het menu van het deelvenster Transformeren anders kiest. Live corner radii scale with the art, unless the scale chooses otherwise. Dynamische hoekradii schalen mee met de illustratie, tenzij het schalen anders kiest. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 46d2cc120b..f36c82c07a 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4648,7 +4648,7 @@ font-technology Variable Zmienne Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Zaznacz › Taki sam › Kolor wypełnienia, Kolor obrysu oraz Wypełnienie i obrys dopasowują tylko ten sam odcień globalnej lub dodatkowej próbki, a nie dowolny jej odcień. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Pokazuje stronę startową, gdy nie jest otwarty żaden dokument; po wyłączeniu okno pozostaje puste, dopóki nie klikniesz Strona startowa. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mierzy obiekty razem z obrysami i efektami zmieniającymi kształt na potrzeby rozmiaru, położenia i wyrównania; cienie, poświaty i rozmycia nie są mierzone. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Przy powiększeniu 100% jeden cal dokumentu wypełnia jeden cal ekranu albo 96 punktów ekranu, gdy system nie podaje rozmiaru ekranu. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Przy powiększeniu 100% jeden cal dokumentu wypełnia jeden cal ekranu albo 96 punktów ekranu, gdy system nie podaje użytecznego rozmiaru ekranu. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dwukrotne kliknięcie grupy, ścieżki lub obrazu narzędziem Zaznaczanie otwiera je w trybie izolacji. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Wypełnienia i obrysy wzorkiem przekształcają się razem z kompozycją, chyba że przekształcenie lub menu panelu Przekształć wybierze inaczej. Live corner radii scale with the art, unless the scale chooses otherwise. Promienie narożników dynamicznych skalują się razem z kompozycją, chyba że skalowanie wybierze inaczej. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 7e03fc77f0..7359c63c3b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2770,7 +2770,7 @@ digits Malayalam Malaiala Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seleção › Igual › Cor de Preenchimento, Cor do Traçado e Preenchimento e Traçado encontram apenas o mesmo tom de uma amostra global ou de cor especial, não qualquer tom dela. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Mostra a tela Início quando nenhum documento está aberto; desativada, a janela fica vazia até você clicar em Início. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mede os objetos com seus traçados e efeitos que mudam a forma para tamanho, posição e alinhamento; sombras, brilhos e desfoques não são medidos. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Com zoom de 100%, uma polegada do documento ocupa uma polegada da tela, ou 96 pontos de tela quando o sistema não informa o tamanho da tela. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Com zoom de 100%, uma polegada do documento ocupa uma polegada da tela, ou 96 pontos de tela quando o sistema não informa um tamanho de tela utilizável. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Clicar duas vezes em um grupo, demarcador ou imagem com a ferramenta Seleção o abre no modo de isolamento. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Preenchimentos e traçados de padrão se transformam com a arte, a menos que uma transformação ou o menu do painel Transformar escolha outra coisa. Live corner radii scale with the art, unless the scale chooses otherwise. Os raios de canto dinâmicos mudam de escala com a arte, a menos que a escala escolha outra coisa. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 731d09bd06..007ed80f9e 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3346,7 +3346,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. «Выделение › То же › Цвет заливки», «Цвет обводки» и «Заливка и обводка» находят только тот же оттенок глобального или плашечного образца, а не любой его оттенок. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показывает начальный экран, когда нет открытых документов; если выключено, окно остаётся пустым, пока вы не нажмёте «Домой». Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Измеряет объекты с обводками и эффектами, меняющими форму, для размера, положения и выравнивания; тени, свечения и размытия не учитываются. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. При масштабе 100 % один дюйм документа занимает один дюйм дисплея или 96 экранных пунктов, если система не сообщает размер дисплея. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. При масштабе 100 % один дюйм документа занимает один дюйм дисплея или 96 экранных пунктов, если система не сообщает пригодный размер дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Двойной щелчок по группе, контуру или изображению инструментом «Выделение» открывает их в режиме изоляции. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Заливки и обводки узором трансформируются вместе с графикой, если трансформирование или меню панели «Трансформировать» не задаёт иное. Live corner radii scale with the art, unless the scale chooses otherwise. Радиусы динамических углов масштабируются вместе с графикой, если масштабирование не задаёт иное. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 597a5dbc1e..76bf7fc17f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3235,7 +3235,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Markera › Samma › Fyllnadsfärg, Konturfärg och Fyllning och kontur hittar bara samma nyans av ett globalt färgprov eller en dekorfärg, inte vilken nyans som helst av det. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Visar startskärmen när inget dokument är öppet; när det är av förblir fönstret tomt tills du klickar på Start. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Mäter objekt med deras konturer och formändrande effekter för storlek, position och justering; skuggor, glöd och oskärpa mäts inte. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Vid 100 % zoom fyller en tum av dokumentet en tum av skärmen, eller 96 skärmpunkter om systemet inte anger skärmens storlek. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Vid 100 % zoom fyller en tum av dokumentet en tum av skärmen, eller 96 skärmpunkter om systemet inte anger en användbar skärmstorlek. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Dubbelklick på en grupp, en bana eller en bild med verktyget Markering öppnar den i isoleringsläge. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Mönsterfyllningar och -konturer transformeras med grafiken, om inte en transformering eller menyn i panelen Transformera väljer annat. Live corner radii scale with the art, unless the scale chooses otherwise. Dynamiska hörnradier skalas med grafiken, om inte skalningen väljer annat. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b4b8af414f..bb509d56b6 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3080,7 +3080,7 @@ digits Malayalam Malayalam Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Seçim › Aynı › Dolgu Rengi, Kontur Rengi ve Doldur ve Konturla yalnızca genel veya spot renk örneğinin aynı tonunu bulur, herhangi bir tonunu değil. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Hiçbir belge açık değilken Ana Sayfa ekranını gösterir; kapalıyken siz Ana Sayfa'ya tıklayana kadar pencere boş kalır. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Nesneleri boyut, konum ve hizalama için konturları ve şekil değiştiren efektleriyle birlikte ölçer; gölgeler, parlamalar ve bulanıklaştırmalar ölçülmez. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. %100 yakınlaştırmada belgenin bir inçi ekranın bir inçini kaplar; sistem ekran boyutunu bildirmezse 96 ekran noktası kaplar. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. %100 yakınlaştırmada belgenin bir inçi ekranın bir inçini kaplar; sistem kullanılabilir bir ekran boyutu bildirmezse 96 ekran noktası kaplar. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Seçim aracıyla bir gruba, yola veya görüntüye çift tıklamak onu yalıtım modunda açar. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Desen dolguları ve konturları, bir dönüşüm veya Dönüştür panelinin menüsü başka bir seçim yapmadıkça resimle birlikte dönüşür. Live corner radii scale with the art, unless the scale chooses otherwise. Canlı köşe yarıçapları, ölçekleme başka bir seçim yapmadıkça resimle birlikte ölçeklenir. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 1be9d21a56..fe18c0556a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3356,7 +3356,7 @@ digits Malayalam Малаялам Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. «Виділення › Те саме › Колір заливки», «Колір обведення» та «Заливка та обведення» знаходять лише той самий відтінок глобального або плашкового зразка, а не будь-який його відтінок. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Показує початковий екран, коли немає відкритих документів; якщо вимкнено, вікно лишається порожнім, доки ви не натиснете «Додому». Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Вимірює об’єкти з обведеннями та ефектами, що змінюють форму, для розміру, положення й вирівнювання; тіні, світіння та розмиття не враховуються. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. За масштабу 100 % один дюйм документа займає один дюйм дисплея або 96 екранних пунктів, якщо система не повідомляє розмір дисплея. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. За масштабу 100 % один дюйм документа займає один дюйм дисплея або 96 екранних пунктів, якщо система не повідомляє придатний розмір дисплея. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Подвійне клацання на групі, контурі або зображенні інструментом «Виділення» відкриває їх у режимі ізоляції. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Заливки й обведення візерунком трансформуються разом із графікою, якщо трансформування або меню панелі «Трансформувати» не задає іншого. Live corner radii scale with the art, unless the scale chooses otherwise. Радіуси динамічних кутів масштабуються разом із графікою, якщо масштабування не задає іншого. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 5bc97afbae..bf64a5ac76 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3676,7 +3676,7 @@ mark-style Japanese Kiểu Nhật Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. Vùng chọn › Giống nhau › Màu tô, Màu nét và Tô & Nét chỉ khớp với cùng sắc độ của một mẫu màu toàn cục hoặc màu pha, không phải mọi sắc độ của nó. Shows the Home screen when no document is open; off, the window stays empty until you click Home. Hiển thị màn hình Trang chủ khi không có tài liệu nào mở; khi tắt, cửa sổ để trống cho đến khi bạn nhấp vào Trang chủ. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. Đo đối tượng cùng với nét và các hiệu ứng thay đổi hình dạng cho kích thước, vị trí và căn chỉnh; bóng đổ, ánh sáng và làm mờ không được đo. - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. Ở mức thu phóng 100%, một inch của tài liệu chiếm một inch trên màn hình, hoặc 96 điểm màn hình khi hệ thống không báo kích thước màn hình. + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. Ở mức thu phóng 100%, một inch của tài liệu chiếm một inch trên màn hình, hoặc 96 điểm màn hình khi hệ thống không báo kích thước màn hình dùng được. Double-clicking a group, path or image with the Selection tool opens it in isolation mode. Nhấp đúp vào một nhóm, đường dẫn hoặc hình ảnh bằng công cụ Vùng chọn sẽ mở nó trong chế độ cô lập. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. Phần tô và nét họa tiết biến đổi cùng hình minh họa, trừ khi phép biến đổi hoặc menu của bảng Biến đổi chọn khác. Live corner radii scale with the art, unless the scale chooses otherwise. Bán kính góc động co giãn cùng hình minh họa, trừ khi phép co giãn chọn khác. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index fd591e2ff4..79986acba9 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3205,7 +3205,7 @@ digits Malayalam 马拉雅拉姆数字 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 选择 › 相同 › 填色、描边颜色和填色和描边只匹配全局色板或专色色板的相同色调,而不是其任意色调。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. 没有打开文档时显示主页屏幕;关闭时,窗口保持空白,直到你点击主页。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 在尺寸、位置和对齐中按对象的描边和改变形状的效果测量对象;阴影、发光和模糊不计入测量。 - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 缩放为 100% 时,文档的一英寸占显示器上的一英寸;系统未报告显示器尺寸时占 96 个屏幕点。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 缩放为 100% 时,文档的一英寸占显示器上的一英寸;系统未报告可用的显示器尺寸时占 96 个屏幕点。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 用选择工具双击编组、路径或图像时,会在隔离模式中打开它。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 图案填色和描边随图稿一起变换,除非变换命令或变换面板的菜单另有选择。 Live corner radii scale with the art, unless the scale chooses otherwise. 实时转角半径随图稿一起缩放,除非缩放命令另有选择。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index a7136b8c76..0d8417a001 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4654,7 +4654,7 @@ digits Malayalam 馬來亞拉姆數字 Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. 選取 › 相同 › 填色顏色、筆畫顏色和填色與筆畫只符合全域色票或特別色色票的相同色調,而不是其任意色調。 Shows the Home screen when no document is open; off, the window stays empty until you click Home. 沒有開啟文件時顯示首頁畫面;關閉時,視窗保持空白,直到你按下首頁。 Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. 在尺寸、位置和對齊中依物件的筆畫和改變形狀的效果測量物件;陰影、光暈和模糊不計入測量。 - At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size. 縮放為 100% 時,文件的一英吋佔顯示器上的一英吋;系統未回報顯示器尺寸時佔 96 個螢幕點。 + At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size. 縮放為 100% 時,文件的一英吋佔顯示器上的一英吋;系統未回報可用的顯示器尺寸時佔 96 個螢幕點。 Double-clicking a group, path or image with the Selection tool opens it in isolation mode. 用選取工具按兩下群組、路徑或影像時,會在隔離模式中開啟它。 Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. 圖樣填色和筆畫隨圖稿一起變形,除非變形指令或變形面板的選單另有選擇。 Live corner radii scale with the art, unless the scale chooses otherwise. 即時轉角半徑隨圖稿一起縮放,除非縮放指令另有選擇。 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 7eda9e95ca..ef79a20221 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -461,6 +461,7 @@ fn run_ui_part5(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { v.zoom = next_zoom(v.zoom, up, print); + v.fit_zoom = None; if let Some(c) = focus { v.center = c; } @@ -479,6 +480,8 @@ fn run_ui_part5(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { v.zoom = z.clamp(0.0313, 640.0); + // A percentage, not a fit: the first reading of the display keeps it. + v.fit_zoom = None; v.fitted = true; if let Some(c) = center { v.center = c; diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 920331ea39..d0f09d63d0 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -485,7 +485,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "view.actualSize", "Actual Size", "Cmd+1", - "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none; the same at every UI Scaling", + "{} 100%: with Display Print Size at 100% Zoom off, one document point per screen point; on, one document inch fills an inch of the display that shows the window, measured from the physical size the system reports for it, or 96 screen points where it reports none or a size no display has; the same at every UI Scaling", ), ("view.setZoom", "Set Zoom", "", "{zoom: percent, center?: [x,y]}"), ( diff --git a/crates/ui-egui/src/prefs_dialog/descriptions.rs b/crates/ui-egui/src/prefs_dialog/descriptions.rs index 0593304e0b..fe1d5bc81b 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -30,7 +30,7 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ ), ( "displayPrintSize", - "At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no display size.", + "At 100% zoom, one inch of the document fills an inch of the display, or 96 screen points where the system reports no usable display size.", ), ("doubleClickToIsolate", "Double-clicking a group, path or image with the Selection tool opens it in isolation mode."), ( diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 751cd87584..133a3ec7e3 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -142,15 +142,19 @@ use std::sync::mpsc::Sender; /// reference density that display scaling is set against (a CSS inch). pub const REFERENCE_PPI: f64 = 96.0; -/// The densities a measured display may have, in screen points per inch. A size outside them is -/// a wrong report (a projector or television that gives its aspect ratio as its size, or none). +/// The pixel densities a measured display may have, in pixels per inch, before the display scale +/// divides them into screen points. A size outside them is a wrong report (a projector or +/// television that gives its aspect ratio as its size, or none). pub const SCREEN_PPI_RANGE: std::ops::RangeInclusive = 30.0..=1000.0; /// The screen points one inch takes at 100% zoom: `None` with Preferences › General › Display /// Print Size at 100% Zoom off, else the measured density of the display (`screen_ppi`, -/// [`crate::Services::screen_ppi`]), or [`REFERENCE_PPI`] when the display has none. +/// [`crate::Services::screen_ppi`]), or [`REFERENCE_PPI`] when the display has none. A measured +/// density is taken when it is finite and positive: the host checks the display's pixels against +/// [`SCREEN_PPI_RANGE`] before the display scale divides them into points, so a point density can +/// fall outside that range. pub fn print_ppi(display_print_size: bool, screen_ppi: Option) -> Option { - display_print_size.then(|| screen_ppi.filter(|p| SCREEN_PPI_RANGE.contains(p)).unwrap_or(REFERENCE_PPI)) + display_print_size.then(|| screen_ppi.filter(|p| p.is_finite() && *p > 0.0).unwrap_or(REFERENCE_PPI)) } /// The preset zoom stops, in percent. @@ -1646,7 +1650,7 @@ mod tests { /// #9051: with Display Print Size on, 100% follows the measured density of the display, so an /// inch of the document takes as many screen points as an inch of that display holds. A - /// density outside the range a display can have counts as no measurement. + /// density that is not finite and positive counts as no measurement. #[test] fn print_size_follows_the_displays_measured_density() { assert_eq!(print_ppi(false, Some(127.0)), None, "the preference off ignores the display"); @@ -1654,9 +1658,11 @@ mod tests { assert!(zoom_baseline(dense) > zoom_baseline(print_ppi(true, None)), "a denser display than the reference zooms 100% further in"); assert!(zoom_baseline(sparse) < zoom_baseline(print_ppi(true, None)), "a sparser one zooms it out"); assert!((zoom_baseline(dense) * 72.0 - 127.0).abs() < 1e-9, "an inch of the document fills an inch of the display"); - for wrong in [Some(0.0), Some(-5.0), Some(f64::NAN), Some(f64::INFINITY), Some(5000.0), None] { + for wrong in [Some(0.0), Some(-5.0), Some(f64::NAN), Some(f64::INFINITY), Some(f64::NEG_INFINITY), None] { assert_eq!(print_ppi(true, wrong), print_ppi(true, None), "{wrong:?} is no measurement"); } + assert_eq!(print_ppi(true, Some(23.15)), Some(23.15), "a display at a large scale factor has few points to an inch"); + assert_eq!(print_ppi(true, Some(1600.0)), Some(1600.0), "and one at a scale below 1 many"); assert_eq!(zoom_label(zoom_from_display_percent(100.0, dense), dense), "100%"); let thin = print_ppi(true, Some(40.0)); assert!(next_zoom(0.0313, false, thin) >= 0.0313, "the last stop down stays in the zoom range"); diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e32dc77d7e..c0ba336669 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1292,7 +1292,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pen rubber band after a smooth anchor:** the preview segment to the pointer is the curve a click there adds, leaving the last anchor along its outgoing handle and arriving at the new corner anchor without a handle, so the segment keeps its shape when the anchor is placed, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/preview-paths-drawn.html) describes. Before, the preview was a different curve, and the segment changed shape at the click (#8296, in part; `pen::tests::rubber_band_is_the_segment_a_click_adds`); scores and estimates unchanged. - **Pen rubber band over an anchor a click ends on:** over the path's first anchor, the preview segment ends on that anchor, as the closing segment does; over an end of another open path, it ends on that end and arrives along the end's own handle, as the joining segment does. The preview picks these anchors at the pointer before snapping, as a press does. Before, the preview ended at the pointer and arrived without a handle, so the segment moved by up to the pick tolerance at the click, and changed shape when the other end was smooth (#8296, in part; the `pen_rubber_band` tests in `engine/tests/it`); scores and estimates unchanged. - The desktop app keeps the Color panel's Show Options or Hide Options between sessions, and `ui.colorPanel` sets its mode and options as its panel menu does. - - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (on by default, as [the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes; in VectorCraft, View › Actual Size shows one document inch in an inch of the display that shows the document's window, measured from the physical size the system reports for that display, or 96 screen points where it reports none; VectorCraft's own rules: a document in a floating window counts from that window's display, where the help page names only the primary monitor, and the preference also applies in Pixel Preview, which the help page leaves out; off, one document point per screen point; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). + - Preferences that act (#394, in part): Show Tool Tips, Double Click To Isolate, Zoom with Mouse Wheel (the wheel zooms about the pointer, Shift-wheel scrolls up and down, Cmd/Ctrl-wheel sideways; Alt/Option-wheel and a trackpad pinch zoom about the pointer either way), Use Precise Cursors; Selection & Anchor Display › Tolerance (objects, anchors and handles), Object Selection by Path Only, Command Click to Select Objects Behind (cycling down the stack), Zoom to Selection, anchor Size, Highlight anchors on mouse over; Type › Number of Recent Fonts (up to 15); Guides & Grid › guide and grid Color and Style (lines or dots) and Grids In Back. Then Snap to Point (its distance, for moves, drawn points and reference points), Move Locked and Hidden Artwork with Artboard, Enable Rubber Band for the Pen and Curvature tools, Handles style, Show handles when multiple anchors are selected, Hide Corner Widget for angles greater than; General › Transform Pattern Tiles (the transforms' and dialogs' Transform Patterns, Align and Distribute, art moved or duplicated with an artboard, and objects moved whole with direct-selected anchors) and Select Same Tint %; Type › Size/Leading, Tracking and Baseline Shift increments (`type.step`, Cmd+Shift+. and Cmd+Shift+, for the size, the Type tool's Alt+arrows), Enable Missing Glyph Protection and Fill New Type Objects With Placeholder Text. Then Smart Guides › Color, Alignment Guides, Anchor/Path Labels, Measurement Labels, Transform Tools, Object Highlighting (with Smart Guides on) and Snapping Tolerance (4 px by default, for every smart guide snap), then Construction Guides and their Angles (#506: a drawn point near a line at one of those angles through the point it leaves from lands on it). Then Type › Type Object Selection by Path Only (type is picked on the baseline of any of its lines, area type's frame or the path of type on a path, no longer anywhere in its bounds; the Type tools and the Eyedropper still take a click among the characters). Then General › Anti-aliased Artwork (off, the canvas draws the art with hard edges). Then Guides & Grid › Show Pixel Grid (Above 600% Zoom), a line at every document pixel over the art in Pixel Preview, turning with a rotated view as the document grid now does too. Then General › Show The Home Screen When No Documents Are Open (off, closing the last document leaves an empty window; the Home button still opens the screen). Then Units › Numbers Without Units Are Points (on by default: a number typed with no unit into a field in picas is read in points, a typed unit still wins; dimmed unless a unit is Picas). Then User Interface › Auto-Collapse Iconic Panels (off by default: on, a click away from a panel popped out of the icon column puts it away). Then Performance › Animated Zoom (on, with GPU Performance, which it needs and which dims it when off: the Zoom tool dragged sideways zooms about the press, right in and left out, and held still zooms on, Alt out; off, a drag zooms to the area dragged across, now drawn as a marquee), User Interface › Large Tabs (taller document tabs) and Scale Cursor Proportional to UI (off, the tool cursors keep their size whatever the UI Scaling), and File Handling › Display Bitmaps as Anti-aliased Images in Pixel Preview (off by default: Pixel Preview draws images with each pixel taking its nearest image pixel). Type › Auto Size New Area Type works too (new area type gets Auto Size). They reach agents too (`prefs.set`, then `pointer_gesture` or `press_key`; `ui.wheel` on the control channel). Then Smart Guides › Spacing Guides (moves space the selection evenly with its row or column, see Drawing aids). Then Hyphenation › Exceptions (comma-separated words that never break, or break only at their hyphens; `prefs.set` and restore push them into the hyphenator, #394). Then Type › Show Font Names in English (off, font menus label a family by its native-language name when the font has one; documents still use the English family, #394). Then General › Display Print Size at 100% Zoom (on by default, as [the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes; in VectorCraft, View › Actual Size shows one document inch in an inch of the display that shows the document's window, measured from the physical size the system reports for that display, or 96 screen points where it reports none or a size no display has; VectorCraft's own rules: a document in a floating window counts from that window's display, where the help page names only the primary monitor, and the preference also applies in Pixel Preview, which the help page leaves out; off, one document point per screen point; `view.actualSize` / `prefs.set`, #394, #9051). Then Guides & Grid › Gridline every and Subdivisions (changing either sets the grid of every open document; new and opened documents take that grid too, except a native file and the native document an SVG, PDF, `.ai` or EPS file carries, which open with the grid they were saved with; `file.new`, `document.open`, `file.newFromTemplate`, `file.revert`, #394). Then Appearance of Black › On Screen (Display All Blacks Accurately by default: pure CMYK black shows through the CMYK profile, a dark grey; Display All Blacks as Rich Black shows it on the canvas as RGB black, also in CMYK documents drawn by ink planes, while rich blacks, black tints and images show as before; `RenderOptions::rich_black`, #394). Then Appearance of Black › Printing / Exporting (Output All Blacks Accurately by default; Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB raster exports and Print as Bitmap; CMYK ink exports and the document stay unchanged; `prefs.blackOutput` / `richBlack`, #394). Then Units › Identify Objects By (Object Name by default: Layers, Variables and Layer Options show and edit free names; XML ID shows and edits AI-style XML ids, `_` for a space and `_xHH_` escapes, and `layer.setProps` / rename refuse invalid ids; the document still stores the object name, #394). Then Type › Highlight Alternate Glyphs (off by default; on, pink shows behind OpenType substitutions on screen, such as ligatures and contextual forms; Document Setup's Highlight Substituted Glyphs stays separate; `prefs.set` key `highlightAlternateGlyphs`, #394). Then Units › East Asian Type (the bullet below). Then User Interface › Open Documents As Tabs (see Window › Arrange). Two stored options still do nothing yet: Plug-ins & Scratch Disks › Primary and Secondary, and Clipboard Handling › Legacy vector clipboard (the audit below). - Preferences › General › Scroll Sideways with Cmd/Ctrl + Wheel (on by default; dimmed while Zoom with Mouse Wheel is on): while Zoom with Mouse Wheel is off, Cmd/Ctrl with a mouse wheel's whole notches scrolls the canvas sideways instead of zooming. Alt + Cmd/Ctrl-wheel and a pinch on a Mac trackpad, on a touch screen or in the web build still zoom about the pointer, and once a trackpad gesture holds Alt, it zooms until it ends, also after Alt is let go. Under either wheel preference, Cmd/Ctrl with a touchpad zooms about the pointer. - Preferences › Type › Highlight Substituted Fonts (on by default) paints pink behind text drawn in a substitute for a missing font in every document, and turning it off removes that highlight everywhere (`prefs.set highlightSubstitutedFonts`); Document Setup keeps Highlight Substituted Glyphs ([help](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html)). - Preferences › User Interface › UI Scaling scales the interface ([help](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/modify-workspaces.html)). VectorCraft's own rule is that it leaves the art's size alone: at a given zoom a document point covers the same device pixels at every UI Scaling, so View › Actual Size shows the art at the same size whatever the UI Scaling. A click, a pinch or wheel zoom about the pointer, a pan, the Zoom tool's marquee, Fit, tiled panes, Pixel Preview and the Navigator's view box use the same mapping. Evidence: `canvas::tests_ui_scaling`, `tiled_documents_fit_their_panes_at_every_ui_scaling`, `the_view_box_outlines_the_canvas_at_every_ui_scaling`. Scores unchanged. From 7bd49975d0af59b2b670e36ba16a0065b338ae0b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 10:47:19 -0800 Subject: [PATCH 5/6] Display Print Size: a zoom set as a percentage keeps it at the first reading A floating window whose view was given a zoom with View > Zoom (or view.setZoom) and whose recorded fit matched that zoom counted the zoom as a fit at its display's first reading, so the percentage changed with the display's density. Only a view whose zoom is still the zoom a fit gave it now counts from the reading without a change of zoom. --- crates/ui-egui/src/doc_windows.rs | 5 ++++- crates/ui-egui/src/doc_windows/tests.rs | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/doc_windows.rs b/crates/ui-egui/src/doc_windows.rs index 058132f839..2eb8c0e5bb 100644 --- a/crates/ui-egui/src/doc_windows.rs +++ b/crates/ui-egui/src/doc_windows.rs @@ -649,7 +649,10 @@ fn take_window_ppi(app: &mut VectorcraftApp, ctx: &egui::Context, ((uid, number) x.was_read |= matches!(shown.ppi, Some(crate::ScreenPpi::Read(_))); let size = shown.body.map(|b| b.size()); let following = view(app, win).is_some_and(|v| v.fitted && shown.fit.is_some_and(|(s, z, c)| Some(s) == size && z == v.zoom && c == v.center)); - app.settle_window_ppi(win, !(following && (first || fitted_now))); + // A zoom set as a percentage (View › Zoom, Actual Size) is not a fit, and the first reading + // keeps its percentage. + let fit = following && view(app, win).is_some_and(|v| v.fit_zoom == Some(v.zoom)); + app.settle_window_ppi(win, !(fit && (first || fitted_now))); // A view that still fits its window keeps fitting it at the zoom the new density gave it. if following && let (Some((s, _, _)), Some(v)) = (shown.fit, view(app, win)) { shown.fit = Some((s, v.zoom, v.center)); diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index fb803249e1..8043b1002f 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -1355,6 +1355,30 @@ fn a_fit_made_while_a_floating_window_is_unread_counts_from_its_last_reading() { assert_eq!(app.print_ppi_of(Some(win)), Some(110.0)); } +/// A zoom set as a percentage on a floating OS window that has not been read yet is not a fit, +/// even when the window recorded that zoom and center as its fit: the first reading of its display +/// keeps the percentage. +#[test] +fn a_zoom_set_before_a_floating_window_is_first_read_keeps_its_percentage() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let uid = app.session.documents()[1].uid; + let win = (1, 1); + app.run("view.setZoom", json!({"zoom": 100})).unwrap(); + let (zoom, center) = (app.views[1].zoom, app.views[1].center); + let body = egui::Rect::from_min_size(Pos2::ZERO, vec2(500.0, 400.0)); + let mut shown = + Shown { ppi: Some(crate::ScreenPpi::Read(Some(91.0))), body: Some(body), fit: Some((body.size(), zoom, center)), ..Default::default() }; + take_window_ppi(&mut app, &ctx, ((uid, 1), true), win, &mut shown); + let pct = crate::state::zoom_display_percent(app.views[1].zoom, app.print_ppi_of(Some(win))); + assert!((pct - 100.0).abs() < 1e-9, "the first reading keeps 100%: {pct}"); + assert!((app.views[1].zoom * 72.0 - 91.0).abs() < 1e-9, "an inch of the document fills an inch of its display"); +} + /// A floating OS window whose view still fits it, moved between two displays read before, keeps /// fitting it at the zoom the new density gives: the fit this frame keeps is the settled one. #[test] From 1de14d2bdd8e968ad9185e3bffe9aecbb1f3f02b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 11:23:44 -0800 Subject: [PATCH 6/6] Display Print Size: a floating window keeps its settled fit while a modal is open A floating OS window whose view fits it and whose display changed density while a dialog or other modal was open settled its zoom, but the window kept the fit from before the change, so the next resize did not fit the view again. The window now keeps the settled zoom and center as its fit while a modal blocks it too. --- crates/ui-egui/src/doc_windows.rs | 13 +++++++++-- crates/ui-egui/src/doc_windows/tests.rs | 30 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/doc_windows.rs b/crates/ui-egui/src/doc_windows.rs index 2eb8c0e5bb..9af012b6ee 100644 --- a/crates/ui-egui/src/doc_windows.rs +++ b/crates/ui-egui/src/doc_windows.rs @@ -525,7 +525,7 @@ pub(crate) fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let Some(win) = find(app, (w.uid, w.view)) else { continue }; let raised = raise == Some((w.uid, w.view)); let mut shown = if native { os_window(app, ctx, &w, (win, blocked), raised) } else { app_window(app, ctx, &w, (win, blocked), raised) }; - take_window_ppi(app, ctx, ((w.uid, w.view), native), win, &mut shown); + take_window_fit(app, ctx, ((w.uid, w.view), native), win, &mut shown); if blocked { continue; } @@ -537,7 +537,6 @@ pub(crate) fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } x.focused = shown.focused; x.body = shown.body; - x.fit = shown.fit; } over_strip |= shown.over_strip; if shown.close { @@ -613,6 +612,16 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, (win, blocked): (Win, bool) (pressed, rect, fit) } +/// Takes the density of the display that `shown`, floating window `key`'s window `win`, was found on +/// ([`take_window_ppi`]), and keeps the fit `shown` holds after it as the window's fit, also while a +/// modal blocks the window. +fn take_window_fit(app: &mut VectorcraftApp, ctx: &egui::Context, ((uid, number), os): ((u64, u32), bool), win: Win, shown: &mut Shown) { + take_window_ppi(app, ctx, ((uid, number), os), win, shown); + if let Some(x) = app.ui.floating.iter_mut().find(|x| x.uid == uid && x.view == number) { + x.fit = shown.fit; + } +} + /// Takes the density of the display that `shown`, floating window `key`'s ([`views::key`]) window /// `win`, was found on, and whether it is an OS window of its own (`os`), and settles the views /// when the density changed ([`VectorcraftApp::settle_window_ppi`]). A view that still has the diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index 8043b1002f..977f061f42 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -1405,3 +1405,33 @@ fn a_fitted_floating_window_moved_to_another_density_keeps_fitting() { assert_ne!(v.zoom, zoom, "the move to a denser display keeps the zoom percentage"); assert_eq!(moved.fit, Some((body.size(), v.zoom, v.center)), "and the fit kept is the settled zoom"); } + +/// A floating OS window whose view fits it, moved to a display of another density while a modal is +/// open, keeps the settled zoom and center as its fit, so the next resize fits it again. +#[test] +fn a_fitted_floating_window_moved_while_a_modal_is_open_keeps_the_settled_fit() { + let mut app = app_with(2); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + app.session.execute("prefs.set", &json!({"key": "displayPrintSize", "value": true})).unwrap(); + app.set_screen_ppi(Some(127.0)); + app.run("window.arrange.floatInWindow", json!({})).unwrap(); + let uid = app.session.documents()[1].uid; + let win = (1, 1); + take_window_fit(&mut app, &ctx, ((uid, 1), true), win, &mut Shown { ppi: Some(crate::ScreenPpi::Read(Some(91.0))), ..Default::default() }); + app.run("view.fitArtboard", json!({})).unwrap(); + let (zoom, center) = (app.views[1].zoom, app.views[1].center); + let body = egui::Rect::from_min_size(Pos2::ZERO, vec2(500.0, 400.0)); + let fit = Some((body.size(), zoom, center)); + if let Some(x) = app.ui.floating.iter_mut().find(|x| x.uid == uid && x.view == 1) { + x.fit = fit; + } + app.ui.about = true; + assert!(crate::panel_docking::modal_open(&app, &ctx), "a modal is open"); + let mut moved = Shown { ppi: Some(crate::ScreenPpi::Read(Some(150.0))), body: Some(body), fit, ..Default::default() }; + take_window_fit(&mut app, &ctx, ((uid, 1), true), win, &mut moved); + let v = app.views[1]; + assert_ne!(v.zoom, zoom, "the move to a denser display keeps the zoom percentage"); + let kept = app.ui.floating.iter().find(|x| x.uid == uid && x.view == 1).and_then(|x| x.fit); + assert_eq!(kept, Some((body.size(), v.zoom, v.center)), "the window keeps the settled zoom and center as its fit"); +}