Display Print Size: on by default, each window counts its own display

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.
This commit is contained in:
dotCooCoo committed 2026-11-22 03:24:23 -08:00
1 parent 050ddcb567
commit 3098776c07
57 files changed
+1303 -212

No files matched your search

+3 -3
View File
@@ -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();
}
}
+630 -85
View File
@@ -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<String>, PhysicalPosition<i32>, PhysicalSize<u32>, 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<f64>,
/// The display read last, with the window's scale factor then.
shown: Option<Shown>,
/// 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<String>,
position: PhysicalPosition<i32>,
size: PhysicalSize<u32>,
/// 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<Option<f64>> {
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<Option<[f64; 2]>, String>;
/// The physical sizes of displays, one for each display read, or why none could be read.
type Reading = Result<Vec<Size>, 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<ScreenDensity>,
}
/// What a display answered: its physical size (`Some(None)` for none), or `None` while it has not
/// answered.
type Answer = Option<Option<[f64; 2]>>;
/// 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<Display>, Option<Display>, 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<f64>,
/// 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<Vec<(Display, Answer)>>,
/// The displays of the last reading that failed, and when it failed.
failed: Option<(Vec<Display>, f64)>,
/// The reading in progress: the displays it reads, and where its result arrives.
running: Option<(Vec<Display>, Receiver<Reading>)>,
/// 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<Densities>,
/// The displays of the last listing.
listed: Option<Vec<Display>>,
/// 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<std::time::Instant>,
}
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<Densities> {
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::<Vec<_>>(), 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<Display>| {
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<Listing>,
start: impl FnOnce(Vec<Display>) -> Result<Receiver<Reading>, String>,
) -> Option<Densities> {
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<Display>, 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<u32>, scale: f64, mm: [f64; 2]) -> Option<f64> {
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<Option<[f64; 2]>, 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<Option<[f64; 2]>, 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::<Outputs>(&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<Display>,
current: usize,
/// The window's display as winit last gave it, when that lags behind the listing.
lagging: Option<Display>,
window_scale: f64,
lists: Cell<usize>,
reads: Cell<usize>,
sender: Option<Sender<Reading>>,
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<Densities> {
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::<Vec<_>>();
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:?}");
}
}
+8 -7
View File
@@ -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<Option<[f64; 2]>, 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)]))
}
+3 -1
View File
@@ -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,
+11
View File
@@ -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);
}
+3
View File
@@ -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
+135 -15
View File
@@ -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<f64> {
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<crate::doc_windows::Win>) -> Option<f64> {
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<f64>) -> 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()?;
+8 -4
View File
@@ -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() {
+12 -1
View File
@@ -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;
+7 -2
View File
@@ -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 };
+76 -12
View File
@@ -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");
@@ -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<crate::render_worker::Job>) {
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();
+8
View File
@@ -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
+3 -1
View File
@@ -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()
+1 -1
View File
@@ -31,7 +31,7 @@ fn view_tab_name(d: &vectorcraft_engine::DocState, number: Option<u32>) -> 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`]).
+1 -1
View File
@@ -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.
+6
View File
@@ -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
+18 -1
View File
@@ -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());
+118 -4
View File
@@ -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<egui::Vec2>,
/// 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<crate::ScreenPpi>,
/// 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<crate::ScreenPpi> {
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<crate::ScreenPpi> {
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<crate::ScreenPpi>);
/// Each floating window with the density of the display that shows it.
pub(crate) fn floating_ppi(app: &VectorcraftApp) -> Vec<FloatingPpi> {
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<f64>) {
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<FloatingPpi>)>,
/// 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<crate::ScreenPpi>,
}
impl Windows {
@@ -382,6 +452,8 @@ struct Shown {
body: Option<egui::Rect>,
/// [`DocWindow::fit`] after this frame.
fit: Option<Fit>,
/// The density of the display that shows its OS window, when it was found on one.
ppi: Option<crate::ScreenPpi>,
}
/// 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
+68
View File
@@ -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");
}
-9
View File
@@ -36,15 +36,6 @@ pub struct Views {
shown: HashMap<u64, u32>,
}
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<u64> {
app.session.documents().get(i).map(|d| d.uid)
}
+1 -1
View File
@@ -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. Радиусите на динамичните ъгли се мащабират заедно с графиката, освен ако мащабирането не избере друго.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. Οι ακτίνες των δυναμικών γωνιών κλιμακώνονται μαζί με το γραφικό, εκτός αν η κλιμάκωση επιλέξει κάτι άλλο.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. લાઇવ ખૂણાઓની ત્રિજ્યાઓ આર્ટવર્ક સાથે સ્કેલ થાય છે, સિવાય કે સ્કેલિંગ બીજું પસંદ કરે.
Can't render this file because it contains an unexpected character in line 72 and column 5.
+1 -1
View File
@@ -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. लाइव कोनों की त्रिज्याएँ आर्टवर्क के साथ स्केल होती हैं, जब तक स्केलिंग कुछ और न चुने।
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. 拡大・縮小で別の指定をしない限り、ライブコーナーの半径をアートワークと一緒に拡大・縮小します。
Can't render this file because it is too large.
+1 -1
View File
@@ -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. ცოცხალი კუთხეების რადიუსები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. 크기 조정에서 달리 선택하지 않는 한, 라이브 모퉁이 반지름이 아트웍과 함께 크기 조정됩니다.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. Радиусы динамических углов масштабируются вместе с графикой, если масштабирование не задаёт иное.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. Радіуси динамічних кутів масштабуються разом із графікою, якщо масштабування не задає іншого.
Can't render this file because it is too large.
+1 -1
View File
@@ -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.
Can't render this file because it is too large.
+1 -1
View File
@@ -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. 实时转角半径随图稿一起缩放,除非缩放命令另有选择。
Can't render this file because it is too large.
+1 -1
View File
@@ -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. 即時轉角半徑隨圖稿一起縮放,除非縮放指令另有選擇。
Can't render this file because it is too large.
+1 -1
View File
@@ -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};
+43 -18
View File
@@ -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, 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.
+62 -2
View File
@@ -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<f64>,
/// [`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<ScreenDensity>,
/// 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<Box<dyn Fn() -> 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<f64>),
}
impl ScreenPpi {
/// The points to an inch, when the display was read and reports a size.
pub fn ppi(self) -> Option<f64> {
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<ScreenPpi> {
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<dyn Fn(&mut egui::RawInput) + Send + Sync>;
+32 -6
View File
@@ -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<crate::ScreenPpi>,
/// 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<f64>,
}
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<Self> {
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>) -> 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>) -> 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]
+2
View File
@@ -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();
}
+1 -1
View File
@@ -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());
+11 -7
View File
@@ -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
+1 -1
View File
@@ -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 byLine truncated
- 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 CMLine truncated
- 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.