Merge origin/main into feat/brushes-item-context-menu

This commit is contained in:
ruchirguitar committed 2026-11-19 15:27:26 +05:30
commit 45afa9761a
20 files changed
+1309 -40

No files matched your search

+2
View File
@@ -1388,4 +1388,6 @@ fn selection_visuals(
#[cfg(test)]
mod tests;
#[cfg(test)]
mod tests_edge_scroll;
#[cfg(test)]
mod tests_ui_scaling;
+82 -2
View File
@@ -5,8 +5,8 @@ use super::drag::{
tool_drag_moved, tool_frame_moves, tool_holds, tool_press_doc_id,
};
use super::view::{
HOLD_DELAY, HOLD_ZOOM, SCRUB_SLOP, SCRUB_ZOOM, WheelTurn, animated_zoom, pan_pixels, pan_ppp, rotate_about, scroll_view, touch_gestures,
trackpad_turn, wheel, whole_pixels, zoom_about,
HOLD_DELAY, HOLD_ZOOM, SCRUB_SLOP, SCRUB_ZOOM, WheelTurn, animated_zoom, edge_scroll, edge_scroll_pixels, pan_pixels, pan_ppp, rotate_about,
scroll_view, touch_gestures, trackpad_turn, wheel, whole_pixels, zoom_about,
};
use super::{Color32, Drag, Mods, Point, PointerEvent, PointerKind, Pos2, Shape, Stroke, Ui, VectorcraftApp, View, Xf, json};
@@ -363,6 +363,8 @@ fn begin_drag(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, p: Pos2) {
if !tool_holds(d) {
app.session.tool_hover_ended(view);
}
// Read before `data_mut`: the context is locked inside it.
let edge = edge_scroll_at_press(ui, p);
ui.data_mut(|dd| {
dd.insert_temp(drag_id(), d);
dd.insert_temp(drag_pos_id(), p);
@@ -370,6 +372,8 @@ fn begin_drag(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, p: Pos2) {
// A new press has not dragged yet, whatever an interrupted one left behind.
dd.remove::<Point>(tool_drag_doc_id());
dd.insert_temp(tool_press_doc_id(), xf.to_doc(p));
// Edge scrolling waits for the pointer to move away from the press ([`edge_scroll_held`]).
dd.insert_temp(edge_scroll_id(), edge);
// Space held at the press (Cmd+Space lends the Zoom tool) sizes the marquee until
// it is let go ([`zoom_marquee_start`]).
if matches!(d, Drag::ZoomBox { .. }) {
@@ -451,6 +455,11 @@ fn drag_held(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, d: Drag, p: Pos2)
// mouse's, a pen's on X11 among them, take the host's latest. Other tools get
// the last position only, so a costly drag preview runs once a frame.
let (moves, last_pose) = tool_frame_moves(ui, app, false);
// Held near an edge of the canvas, the drag scrolls the view so it can go on past
// what shows (#8551). The moves above came before the scroll and keep the view they
// were made in; the pointer's position takes the scrolled one, so the tool gets a
// new document position though the pointer stands still.
let xf = edge_scroll_held(app, ui, f, p).unwrap_or(xf);
// A frame whose pointer ends where the last one did still moved in between.
let backquote = ui.input(|i| i.key_down(egui::Key::Backtick));
let mods_changed = tool_drag_mods_changed(ui, mods(m, space), backquote);
@@ -477,6 +486,77 @@ fn drag_held(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, d: Drag, p: Pos2)
}
}
/// How far the pointer moves on screen from the press, in points, before a held tool drag
/// scrolls the view at an edge of the canvas ([`edge_scroll_held`]).
const EDGE_SCROLL_SLOP: f32 = 3.0;
/// A tool press's edge scrolling ([`edge_scroll_held`]), set when the press begins: where on screen
/// it was pressed, whether the pointer has since moved away from there, and the part of a device
/// pixel the scrolls of this press have left along each axis. Its own remainder, so the scrolls of
/// one press neither take nor leave part of a wheel scroll's.
#[derive(Clone, Copy, Debug, PartialEq)]
struct EdgeScroll {
press: Pos2,
armed: bool,
rest: (f64, f64),
}
fn edge_scroll_id() -> egui::Id {
egui::Id::unique("canvas-edge-scroll")
}
/// A tool press's edge scrolling as it begins at `p`, the pointer's position at the end of the
/// frame: the press is where the primary button went down, which an input batch can leave behind
/// `p`, and the moves after it in the same frame may already have gone [`EDGE_SCROLL_SLOP`] from it.
fn edge_scroll_at_press(ui: &Ui, p: Pos2) -> EdgeScroll {
let (press, moved) = ui.input(|i| {
let down = i.events.iter().rposition(|e| matches!(e, egui::Event::PointerButton { button: egui::PointerButton::Primary, pressed: true, .. }));
let press = down.and_then(|k| match i.events.get(k) {
Some(egui::Event::PointerButton { pos, .. }) => Some(*pos),
_ => None,
});
let press = press.unwrap_or(p);
let after = down.map_or(0, |k| k + 1);
let moved = i.events.iter().skip(after).any(|e| matches!(e, egui::Event::PointerMoved(q) if (*q - press).length() >= EDGE_SCROLL_SLOP));
(press, moved)
});
EdgeScroll { press, armed: moved || (p - press).length() >= EDGE_SCROLL_SLOP, rest: (0.0, 0.0) }
}
/// Scroll the view for a tool drag held at `p` near an edge of the canvas ([`edge_scroll`]), and
/// return the canvas's transform after it; `None` when the view did not move. Only once the pointer
/// has moved [`EDGE_SCROLL_SLOP`] from the press on screen, in any move of a frame (a click near the edge stays a click, and
/// a view scrolled by the wheel under a still press is not a drag), with the pointer over the
/// canvas itself (over a panel the Selection tools hand the art to the panels), and not under a
/// modal dialog. The view moves by whole device pixels; the part of a pixel left over waits for the
/// next frame on an axis that scrolls on, and stays as it is on one that does not.
fn edge_scroll_held(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, p: Pos2) -> Option<Xf> {
let mut st = ui.data(|d| d.get_temp::<EdgeScroll>(edge_scroll_id()))?;
// Any move of the frame counts, not only where the pointer ends up: one that went away and came
// back to the press still dragged.
let moved = |q: Pos2| (q - st.press).length() >= EDGE_SCROLL_SLOP;
if !st.armed && (moved(p) || ui.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::PointerMoved(q) if moved(*q))))) {
st.armed = true;
ui.data_mut(|d| d.insert_temp(edge_scroll_id(), st));
}
if !st.armed || f.modal || !ui.input(|i| i.pointer.has_pointer()) || !on_canvas(ui, f.resp, p) {
return None;
}
let by = edge_scroll(f.rect, p, ui.input(|i| i.unstable_dt))?;
let ppp = pan_ppp(app, ui);
let ui_zoom = app.canvas_ui_zoom;
let ((dx, dy), rest) = edge_scroll_pixels(st.rest, by, ppp);
st.rest = rest;
ui.data_mut(|d| d.insert_temp(edge_scroll_id(), st));
if dx == 0.0 && dy == 0.0 {
return None;
}
let vm = app.view_mut()?;
pan_pixels(vm, (ppp, ui_zoom), (dx, dy));
let v = *vm;
Some(Xf::at(f.rect, &v, ui_zoom))
}
/// A drag for each of this frame's moves before the pointer's position ([`tool_frame_moves`]), each
/// with the pressure and the tilt and rotation the host's feed kept for that move, else the latest.
fn dispatch_frame_moves(app: &mut VectorcraftApp, ui: &Ui, f: &Pointing, backquote: bool, moves: Vec<FrameMove>) {
@@ -0,0 +1,267 @@
//! A tool drag held near an edge of the canvas scrolls the view so the drag can go on past what
//! shows (#8551): a Selection tool move carries the art along, a drawing tool's shape grows, and
//! the view stops once the pointer leaves the edge. A click near the edge scrolls nothing.
use super::view::{EDGE_SCROLL_SPEED, EDGE_SCROLL_ZONE, edge_scroll, edge_scroll_pixels};
use super::*;
use vectorcraft_engine::Session;
/// One headless canvas frame on an 800 × 600 window.
fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) {
let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
out.textures_delta.clear();
}
fn button(pos: Pos2, pressed: bool) -> egui::Event {
egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }
}
/// A 400 × 300 document with a 100 pt square at (50, 50), zoomed in to 4× about the square's
/// centre, with `tool` selected; the frame drawn once.
fn zoomed_in(tool: &str) -> (VectorcraftApp, egui::Context, vectorcraft_doc::NodeId) {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
let id = app.session.execute("shape.rectangle", &json!({"x": 50, "y": 50, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap();
app.select_tool(tool);
let ctx = egui::Context::default();
frame(&mut app, &ctx, vec![]);
let v = app.view_mut().unwrap();
v.zoom = 4.0;
v.center = Point::new(100.0, 100.0);
frame(&mut app, &ctx, vec![]);
(app, ctx, vectorcraft_doc::NodeId(id))
}
fn center(app: &VectorcraftApp) -> Point {
app.view().unwrap().center
}
#[test]
fn edge_scroll_moves_the_content_away_from_the_edge_the_pointer_is_near() {
let r = egui::Rect::from_min_size(pos2(100.0, 50.0), vec2(600.0, 400.0));
let dt = 0.1;
let full = EDGE_SCROLL_SPEED * dt;
// Away from the edges, or off the canvas, nothing.
assert_eq!(edge_scroll(r, r.center(), dt), None);
assert_eq!(edge_scroll(r, pos2(r.right() + 5.0, r.center().y), dt), None, "over a panel");
assert_eq!(edge_scroll(r, pos2(r.right() - EDGE_SCROLL_ZONE, r.center().y), dt), None, "at the zone's inner side");
assert_eq!(edge_scroll(r, pos2(r.right() - 1.0, r.center().y), 0.0), None, "no time passed");
assert_eq!(edge_scroll(r, pos2(f32::NAN, r.center().y), dt), None);
// At the right edge the content moves left at full speed; half way into the zone, at half.
let right = edge_scroll(r, pos2(r.right(), r.center().y), dt).unwrap();
assert!((right.x + full).abs() < 1e-3 && right.y == 0.0, "{right:?}");
let half = edge_scroll(r, pos2(r.right() - EDGE_SCROLL_ZONE / 2.0, r.center().y), dt).unwrap();
assert!((half.x + full / 2.0).abs() < 1e-3, "{half:?}");
// Near the left and top edges it moves right and down; in a corner, both ways.
assert!(edge_scroll(r, pos2(r.left() + 1.0, r.center().y), dt).unwrap().x > 0.0);
let corner = edge_scroll(r, pos2(r.left() + 1.0, r.top() + 1.0), dt).unwrap();
assert!(corner.x > 0.0 && corner.y > 0.0, "{corner:?}");
// In a corner both ways, but no faster than at one edge.
let corner = edge_scroll(r, pos2(r.right() - 1.0, r.bottom() - 1.0), dt).unwrap();
assert!(corner.x < 0.0 && corner.y < 0.0 && corner.length() <= full + 1e-3, "{corner:?}");
assert!(edge_scroll(r, pos2(r.center().x, r.bottom() - 1.0), dt).unwrap().y < 0.0);
// A stalled frame scrolls a tenth of a second's worth at most.
assert_eq!(edge_scroll(r, pos2(r.right(), r.center().y), 5.0), Some(right));
}
/// The view moves by whole device pixels, keeping the rest for the press's next scroll; an axis
/// the scroll does not move keeps its remainder untouched rather than rounding it each frame.
#[test]
fn edge_scroll_pixels_keep_the_remainder_of_an_axis_that_does_not_scroll() {
// 10.5 pixels: 11 now (rounded away from zero), half a pixel back owed.
let (d, rest) = edge_scroll_pixels((0.0, 0.0), vec2(-10.5, 0.0), 1.0);
assert_eq!(d, (-11.0, 0.0));
assert_eq!(rest, (0.5, 0.0));
// Along the top edge only: x keeps its half pixel, frame after frame, and does not move.
let mut rest = rest;
for _ in 0..4 {
let (d, r) = edge_scroll_pixels(rest, vec2(0.0, 7.0), 1.0);
assert_eq!(d, (0.0, 7.0));
assert_eq!(r.0, 0.5, "x keeps its remainder");
rest = r;
}
// Scrolling that way again, it counts: 0.5 + 1.5 = 2 pixels.
assert_eq!(edge_scroll_pixels(rest, vec2(1.5, 0.0), 1.0).0, (2.0, 0.0));
// At 2 device pixels a point.
assert_eq!(edge_scroll_pixels((0.0, 0.0), vec2(0.25, -1.0), 2.0), ((1.0, -2.0), (-0.5, 0.0)));
}
/// The issue's case: zoomed in, a selected object dragged towards the panels on the right reaches
/// the canvas's edge. Held there, the view scrolls right and the object goes on with the pointer;
/// back away from the edge, the view stops.
#[test]
fn a_move_held_near_the_right_edge_scrolls_the_view_and_carries_the_art() {
let (mut app, ctx, id) = zoomed_in("selection");
let rect = app.canvas_rect.unwrap();
let xf = Xf::new(rect, app.view().unwrap());
let left = |app: &VectorcraftApp| app.session.active().unwrap().doc.node(id).unwrap().geometric_bounds().unwrap().x0;
let start = xf.to_screen(Point::new(100.0, 100.0));
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start + vec2(20.0, 0.0))]);
let edge = pos2(rect.right() - 4.0, start.y);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(edge)]);
let (c0, x0) = (center(&app), left(&app));
// Held still at the edge, frame after frame the view scrolls right and the art keeps up.
let mut last = (c0, x0);
for _ in 0..5 {
frame(&mut app, &ctx, vec![]);
let now = (center(&app), left(&app));
assert!(now.0.x > last.0.x, "the view scrolls right: {:?} then {:?}", last.0, now.0);
assert!((now.0.y - c0.y).abs() < 1e-9, "and only right");
assert!(now.1 > last.1, "the art moves with the pointer: {} then {}", last.1, now.1);
last = now;
}
// The art stays under the pointer: it moved as far as the view (give or take the move's
// rounding to the pixel grid).
assert!(((last.1 - x0) - (last.0.x - c0.x)).abs() < 1.0, "art {} view {}", last.1 - x0, last.0.x - c0.x);
assert!(app.session.active().unwrap().interaction.is_some(), "still the same move");
// Back away from the edge the view stops.
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(rect.center())]);
let stopped = center(&app);
frame(&mut app, &ctx, vec![]);
frame(&mut app, &ctx, vec![]);
assert_eq!(center(&app), stopped, "the view stops away from the edge");
// The release ends the move where the art is.
let moved = left(&app);
frame(&mut app, &ctx, vec![button(rect.center(), false)]);
let st = app.session.active().unwrap();
assert!(st.interaction.is_none());
assert!((left(&app) - moved).abs() < 1e-6);
assert!(moved > 50.0 + (last.0.x - c0.x), "the art went past where the edge showed at first");
}
/// A drawing tool's drag scrolls too: a rectangle dragged to the bottom edge goes on growing.
#[test]
fn a_rectangle_drag_held_near_the_bottom_edge_keeps_growing() {
let (mut app, ctx, _) = zoomed_in("rectangle");
let rect = app.canvas_rect.unwrap();
// Away from the selected square's centre point, where a press moves the square (#5477).
let start = rect.center() - vec2(150.0, 100.0);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start + vec2(10.0, 10.0))]);
let edge = pos2(start.x + 10.0, rect.bottom() - 2.0);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(edge)]);
let c0 = center(&app);
// The bottom of the rectangle drawn so far: the preview in the document.
let preview_bottom = |app: &VectorcraftApp| {
let st = app.session.active().unwrap();
let mut bottom = f64::MIN;
st.doc.walk(|n| {
if let Some(b) = n.geometric_bounds() {
bottom = bottom.max(b.y1);
}
});
bottom
};
for _ in 0..4 {
frame(&mut app, &ctx, vec![]);
// Each held frame the preview reaches the pointer in the view as it is now.
let now = Xf::new(rect, app.view().unwrap()).to_doc(edge).y;
assert!((preview_bottom(&app) - now).abs() < 0.5, "the preview follows the pointer: {} vs {now}", preview_bottom(&app));
}
let c1 = center(&app);
assert!(c1.y > c0.y && (c1.x - c0.x).abs() < 1e-9, "the view scrolls down: {c0:?} then {c1:?}");
let xf = Xf::new(rect, app.view().unwrap());
let bottom = xf.to_doc(edge).y;
frame(&mut app, &ctx, vec![button(edge, false)]);
let st = app.session.active().unwrap();
let made = st.selection.objects.first().and_then(|id| st.doc.node(*id)).and_then(|n| n.geometric_bounds()).unwrap();
assert!((made.y1 - bottom).abs() < 0.5, "the rectangle reaches the pointer in the scrolled view: {} vs {bottom}", made.y1);
}
/// A press near the edge that has not dragged is a click: the view stays.
#[test]
fn a_press_held_still_near_the_edge_does_not_scroll() {
let (mut app, ctx, _) = zoomed_in("selection");
let rect = app.canvas_rect.unwrap();
let at = pos2(rect.right() - 4.0, rect.center().y);
let c0 = center(&app);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at), button(at, true)]);
for _ in 0..4 {
frame(&mut app, &ctx, vec![]);
}
assert_eq!(center(&app), c0);
frame(&mut app, &ctx, vec![button(at, false)]);
assert_eq!(center(&app), c0);
}
/// The Hand tool's own drag is not a tool drag: held near the edge it pans with the pointer only.
#[test]
fn a_hand_drag_held_near_the_edge_does_not_scroll_on() {
let (mut app, ctx, _) = zoomed_in("hand");
let rect = app.canvas_rect.unwrap();
let start = rect.center();
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]);
let edge = pos2(rect.right() - 4.0, start.y);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(edge)]);
let c0 = center(&app);
for _ in 0..3 {
frame(&mut app, &ctx, vec![]);
}
assert_eq!(center(&app), c0);
frame(&mut app, &ctx, vec![button(edge, false)]);
}
/// A press held still near the edge while the wheel scrolls the view is not a drag: the pointer
/// has not moved on screen, so the view does not go on scrolling after the wheel stops.
#[test]
fn a_wheel_scroll_under_a_still_press_near_the_edge_does_not_start_edge_scrolling() {
let (mut app, ctx, _) = zoomed_in("selection");
let rect = app.canvas_rect.unwrap();
let at = pos2(rect.right() - 4.0, rect.center().y);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at), button(at, true)]);
let wheel = egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Point,
delta: vec2(0.0, 40.0),
phase: egui::TouchPhase::Move,
modifiers: Default::default(),
source: egui::MouseWheelSource::Unknown,
};
let c0 = center(&app);
frame(&mut app, &ctx, vec![wheel]);
let wheeled = center(&app);
assert_ne!(wheeled, c0, "the wheel scrolls the view");
for _ in 0..4 {
frame(&mut app, &ctx, vec![]);
}
// The wheel's own scroll eases out along y over these frames; the right edge would scroll x.
assert_eq!(center(&app).x, wheeled.x, "no edge scrolling");
frame(&mut app, &ctx, vec![button(at, false)]);
}
/// The press is where the button went down, not where the frame's input left the pointer: a press
/// well inside the canvas and a move to the edge in the same input batch has dragged, so holding
/// the pointer still there scrolls.
#[test]
fn a_press_and_a_move_to_the_edge_in_one_frame_scroll_once_held() {
let (mut app, ctx, _) = zoomed_in("selection");
let rect = app.canvas_rect.unwrap();
let start = pos2(rect.center().x, rect.bottom() - 30.0);
let edge = pos2(start.x, rect.bottom() - 4.0);
let c0 = center(&app);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true), egui::Event::PointerMoved(edge)]);
for _ in 0..3 {
frame(&mut app, &ctx, vec![]);
}
assert!(center(&app).y > c0.y, "the view scrolls down: {:?} vs {c0:?}", center(&app));
frame(&mut app, &ctx, vec![button(edge, false)]);
}
/// A move away from the press and back within one frame still dragged: the press held near the
/// edge then scrolls, though the pointer ends the frame where it was pressed.
#[test]
fn a_move_away_and_back_within_a_frame_still_arms_edge_scrolling() {
let (mut app, ctx, _) = zoomed_in("selection");
let rect = app.canvas_rect.unwrap();
let at = pos2(rect.right() - 4.0, rect.center().y);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at), button(at, true)]);
let c0 = center(&app);
let away = at - vec2(8.0, 0.0);
frame(&mut app, &ctx, vec![egui::Event::PointerMoved(away), egui::Event::PointerMoved(at + vec2(-0.5, 0.0))]);
for _ in 0..3 {
frame(&mut app, &ctx, vec![]);
}
assert!(center(&app).x > c0.x, "the view scrolls right: {:?} vs {c0:?}", center(&app));
frame(&mut app, &ctx, vec![button(at, false)]);
}
+61
View File
@@ -125,6 +125,67 @@ pub(super) fn rotate_about(vm: &mut View, rect: egui::Rect, p: Pos2, degrees: f6
vm.center += before - Xf::at(rect, vm, ui_zoom).to_doc(p);
}
/// How far in from each edge of the canvas a held tool drag scrolls the view ([`edge_scroll`]), in
/// screen points.
pub(super) const EDGE_SCROLL_ZONE: f32 = 24.0;
/// How fast the view scrolls with the pointer at the canvas's very edge ([`edge_scroll`]), in
/// screen points a second. Nearer the inner side of the zone it scrolls slower.
pub(super) const EDGE_SCROLL_SPEED: f32 = 900.0;
/// How far a tool drag held at `p` near an edge of the canvas `rect` scrolls the view in `dt`
/// seconds (#8551), as the screen points the content moves: away from that edge, so what lies
/// past it comes into view, faster the nearer the pointer is to the edge. `None` with the pointer
/// outside the canvas or away from its edges, or with no time passed. A stalled frame counts a
/// tenth of a second at most, and in a corner the content moves no faster than near one edge.
pub(super) fn edge_scroll(rect: egui::Rect, p: Pos2, dt: f32) -> Option<egui::Vec2> {
if !rect.contains(p) || !p.x.is_finite() || !p.y.is_finite() || !dt.is_finite() || dt <= 0.0 {
return None;
}
// On a canvas narrower than two zones, each zone reaches the middle at most.
let zone_x = EDGE_SCROLL_ZONE.min(rect.width() / 2.0);
let zone_y = EDGE_SCROLL_ZONE.min(rect.height() / 2.0);
// How deep into a zone the pointer is (0 at its inner side, 1 at the edge), signed by the way
// the content moves: near the left or top edge it moves right or down.
let depth = |near: f32, far: f32, zone: f32| {
if zone <= 0.0 {
0.0
} else if near < zone {
1.0 - near / zone
} else if far < zone {
far / zone - 1.0
} else {
0.0
}
};
let dx = depth(p.x - rect.left(), rect.right() - p.x, zone_x);
let dy = depth(p.y - rect.top(), rect.bottom() - p.y, zone_y);
if dx == 0.0 && dy == 0.0 {
return None;
}
// In a corner the scroll goes both ways, no faster than along one edge.
let v = egui::vec2(dx, dy);
let v = if v.length() > 1.0 { v / v.length() } else { v };
Some(v * (EDGE_SCROLL_SPEED * dt.min(0.1)))
}
/// An edge scroll of `by` screen points ([`edge_scroll`]) at `ppp` device pixels a point, after the
/// scrolls of the same press left `rest` device pixels along each axis: the whole device pixels to
/// move the content by, and what is left. An axis this scroll does not move keeps its remainder as
/// it is: rounding a half pixel there would move the view one pixel back and forth each frame.
pub(super) fn edge_scroll_pixels(rest: (f64, f64), by: egui::Vec2, ppp: f32) -> ((f64, f64), (f64, f64)) {
let step = |rest: f64, by: f32| {
if by == 0.0 {
return (0.0, rest);
}
let total = rest + f64::from(by) * f64::from(ppp);
let whole = total.round();
(whole, total - whole)
};
let ((dx, rx), (dy, ry)) = (step(rest.0, by.x), step(rest.1, by.y));
((dx, dy), (rx, ry))
}
/// Move view `vm`'s content by `(dx, dy)` device pixels along the screen's axes, at `ppp` device
/// pixels a point of an interface zoomed by `ui_zoom`: the canvas's frame moves by exactly those
/// pixels.
+3 -1
View File
@@ -574,10 +574,12 @@ pub(super) fn artboard_list(app: &VectorcraftApp, ui: &mut Ui, cur: usize) -> Op
}
// Every number ends where the widest one ends.
let numbers = ui.painter().layout_no_wrap(boards.len().to_string(), egui::FontId::proportional(12.0), t.text_dim).size().x;
let width = ui.available_width().max(LIST_W);
let mut chosen = None;
ui.spacing_mut().item_spacing.y = 0.0;
area.show_rows(ui, ROW_H, boards.len(), |ui, range| {
// The width beside the scroll bar's column: rows as wide as the list
// itself would widen it by the bar on every pass.
let width = ui.available_width().max(LIST_W);
for i in range {
let Some(board) = boards.get(i) else { continue };
let (r, resp) = ui.allocate_exact_size(vec2(width, ROW_H), Sense::click());
+26
View File
@@ -1697,6 +1697,32 @@ fn the_artboard_list_lays_out_only_the_rows_near_the_view() {
assert_eq!(app.view().unwrap().artboard, 999);
}
/// #5941: with the app's scroll bar, which takes a column of its own, the artboard list's rows took
/// the whole list's width, so the list grew by the bar's width on every pass. Open, it keeps its
/// width.
#[test]
fn the_artboard_list_keeps_its_width_while_it_is_open() {
let mut app = crate::VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 100, "height": 100, "artboards": 30})).unwrap();
app.canvas_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(460.0, 260.0)));
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
crate::theme::apply(&ctx, Default::default());
let texts = status_texts(&mut app, &ctx, vec![]);
let field = texts.iter().find(|(s, _)| s == "1 Artboard 1").map(|(_, r)| *r).expect("the field");
status_click(&mut app, &ctx, field.center());
let list = |ctx: &egui::Context| {
ctx.memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id)))
};
let widths: Vec<f32> = (0..8)
.map(|_| {
status_texts(&mut app, &ctx, vec![]);
list(&ctx).expect("the list is open").width()
})
.collect();
assert!(widths.windows(2).skip(2).all(|w| w[0] == w[1]), "the list keeps its width: {widths:?}");
}
fn artboard_navigation_app(tool: &str) -> (crate::VectorcraftApp, vectorcraft_doc::NodeId) {
let mut app = crate::VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 200, "height": 100, "artboards": 3})).unwrap();
+37 -15
View File
@@ -354,22 +354,46 @@ fn button_width(ui: &Ui) -> f32 {
})
}
/// A compact width shared by the heading and body, bounded by the available window width.
fn layout_size(ui: &Ui) -> (f32, f32, f32, bool) {
/// A compact width shared by the heading and body, bounded by the available window width, and the
/// width of the body's scroll bar column. While the body scrolls, the width leaves out that column,
/// so the body and its bar fit in the window side by side.
fn layout_size(ui: &Ui) -> (f32, f32, f32, bool, f32) {
let button_w = button_width(ui);
let values_w = PREVIEW_W + COLUMN_GAP + button_w;
let fixed_w = SLIDER_GAP + SLIDER_W + COLUMN_GAP + values_w;
let stacked = ui.available_width() < MIN_FIELD + fixed_w;
let side = (ui.available_width() - fixed_w).clamp(MIN_FIELD, FIELD);
(side, values_w, button_w, stacked)
let fit = |room: f32| ((room - fixed_w).clamp(MIN_FIELD, FIELD), room < MIN_FIELD + fixed_w);
let (side, stacked) = fit(ui.available_width());
// The margin keeps the bar's column whenever the body may scroll, as its height is estimated.
if body_height(ui, side, stacked) + 40.0 > scroll_height(ui) {
let bar = ui.spacing().scroll.allocated_width();
let (side, stacked) = fit(ui.available_width() - bar);
(side, values_w, button_w, stacked, bar)
} else {
(side, values_w, button_w, stacked, 0.0)
}
}
/// The tallest the body's scrolling content is drawn.
fn scroll_height(ui: &Ui) -> f32 {
(ui.ctx().content_rect().height() - 112.0).max(1.0)
}
/// How tall the body's field, slider and value columns are with a field `side` wide, `stacked` or
/// side by side.
fn body_height(ui: &Ui, side: f32, stacked: bool) -> f32 {
// Let the auto-sized window grow for the checkbox too, rather than clipping it to the
// scroll area's previous height while the dialog measures itself.
let field_h = side + 8.0 + 20.0 + 2.0 * ui.spacing().item_spacing.y;
if stacked { field_h + COLUMN_GAP + FIELD } else { field_h.max(FIELD) }
}
/// Full-width, draggable title band using the app's existing theme colours.
fn header(ui: &mut Ui, title: &str) {
let (side, values_w, _, stacked) = layout_size(ui);
let (side, values_w, _, stacked, bar) = layout_size(ui);
let field_w = side + SLIDER_GAP + SLIDER_W;
let width = if stacked { field_w.max(values_w) } else { field_w + COLUMN_GAP + values_w };
ui.set_width(width.min(ui.available_width()));
// The width includes the bar's column: the body measures from it and leaves the column out.
ui.set_width((width + bar).min(ui.available_width()));
let margin = f32::from(super::MARGIN);
let (r, _) = ui.allocate_exact_size(vec2(ui.available_width(), HEADER_H - margin), Sense::hover());
let band = Rect::from_min_max(r.min - vec2(margin, margin), r.max + vec2(margin, 0.0));
@@ -393,7 +417,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> DialogAction {
let original = d.fields.get("original").and_then(color_value).unwrap_or(p.color);
let gamut = gamut_fix(app, ui.ctx(), "picker-gamut", &p.color);
super::modal::fits_itself(ui);
let (side, values_w, button_w, stacked) = layout_size(ui);
let (side, values_w, button_w, stacked, _) = layout_size(ui);
let field_w = side + SLIDER_GAP + SLIDER_W;
let content_w = if stacked { field_w.max(values_w) } else { field_w + COLUMN_GAP + values_w };
let mut pick: Option<Picked> = None;
@@ -403,11 +427,8 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> DialogAction {
let mut action = DialogAction::None;
// Shrink the field first, then stack the columns in narrow windows. Only vertical
// scrolling is needed, so no controls depend on a horizontal scrollbar.
let height = (ui.ctx().content_rect().height() - 112.0).max(1.0);
// Let the auto-sized window grow for the checkbox too, rather than clipping it to the
// scroll area's previous height while the dialog measures itself.
let field_h = side + 8.0 + 20.0 + 2.0 * ui.spacing().item_spacing.y;
let body_height = if stacked { field_h + COLUMN_GAP + FIELD } else { field_h.max(FIELD) };
let height = scroll_height(ui);
let body_height = body_height(ui, side, stacked);
let layout = if stacked { egui::Layout::top_down(egui::Align::Min) } else { egui::Layout::left_to_right(egui::Align::Min) };
egui::ScrollArea::vertical()
.id_salt("cp-content")
@@ -710,8 +731,9 @@ fn swatch_list(app: &VectorcraftApp, ui: &mut Ui, d: &mut Dialog, current: &Colo
ui.add_space(4.0);
widgets::list_box(ui, |ui| {
let max_h = (side - 28.0).max(1.0);
egui::ScrollArea::vertical().id_salt("cp-swatches").max_height(max_h).show(ui, |ui| {
ui.set_width(list_w - 8.0);
// The rows take the list's width less its scroll bar's column.
egui::ScrollArea::vertical().id_salt("cp-swatches").max_width(list_w - 8.0).max_height(max_h).auto_shrink([false, true]).show(ui, |ui| {
ui.set_width(ui.available_width());
let cur = d.str("library");
if cur.is_empty() || cur == swatchlib::DOCUMENT_SWATCHES {
let Some(st) = app.session.active() else {
@@ -776,6 +776,73 @@ fn compact_picker_shrinks_then_scrolls_without_enlarging_the_window() {
}
}
/// #5941: in a window short enough to scroll the picker, at any width, its scroll bar shows
/// inside the window and the content fits beside it: no label is cut off at the side.
#[test]
fn a_scrolling_picker_shows_its_bar_and_fits_its_content_beside_it() {
fn sideways_clipped(shape: &egui::Shape, clip: Rect, out: &mut Vec<String>) {
match shape {
egui::Shape::Text(t) => {
let r = t.visual_bounding_rect();
let rows_shown = clip.top() <= r.top() && r.bottom() <= clip.bottom();
if rows_shown && !t.galley.text().trim().is_empty() && (r.left() < clip.left() - 1.0 || r.right() > clip.right() + 1.0) {
out.push(format!("{:?} {r:?} in {clip:?}", t.galley.text()));
}
}
egui::Shape::Vec(v) => v.iter().for_each(|s| sideways_clipped(s, clip, out)),
_ => {}
}
}
for width in (400..=800).step_by(8) {
let size = vec2(width as f32, 380.0);
let (ctx, mut app) = (context(), app());
app.run("ui.colorPicker", json!({"color": "#0000ff"})).unwrap();
settled(&ctx, &mut app, size);
let input = egui::RawInput { screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, size)), ..Default::default() };
let mut out = ctx.run_ui(input, |ui| super::super::show(&mut app, ui.ctx()));
out.textures_delta.clear();
let mut clipped = vec![];
for s in &out.shapes {
sideways_clipped(&s.shape, s.clip_rect, &mut clipped);
}
assert!(clipped.is_empty(), "{size:?}: {clipped:?}");
let outer = ctx.memory(|m| m.area_rect(egui::Id::unique(("dialog", KIND)))).unwrap();
assert!(outer.left() >= -0.5 && outer.right() <= size.x + 0.5, "{size:?}: the window {outer:?} stays on screen");
// The content's scroll bar: a narrow filled rectangle taller than a row, inside the window.
let mut bars = vec![];
let mut walk = vec![];
out.shapes.iter().for_each(|c| walk.push(c.shape.clone()));
while let Some(s) = walk.pop() {
match s {
egui::Shape::Vec(v) => walk.extend(v),
egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect),
_ => {}
}
}
assert!(bars.iter().any(|b| outer.contains_rect(*b)), "{size:?}: the content scrolls and its bar shows in {outer:?}: {bars:?}");
}
}
/// #5941: while the body scrolls, the heading sets the dialog's width to the one the body lays its
/// field and columns out in, with the scroll bar's column, so the body measures the same layout from
/// it and does not leave out the bar's column a second time.
#[test]
fn the_heading_leaves_the_body_the_width_of_the_layout_it_measured() {
let ctx = context();
for width in (400..=800).step_by(4) {
let size = vec2(width as f32, 380.0);
let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, size)), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| {
let (side, _, _, stacked, bar) = layout_size(ui);
assert!(bar > 0.0, "{size:?}: the body scrolls");
header(ui, "Color Picker");
let (body_side, _, _, body_stacked, _) = layout_size(ui);
assert_eq!((body_side, body_stacked), (side, stacked), "{size:?}: the body lays out the field and columns the heading measured");
});
out.textures_delta.clear();
}
}
/// Type all three Lab components through the numeric fields, then apply the picked color.
#[test]
fn native_lab_entry_in_color_picker() {
+103
View File
@@ -244,6 +244,109 @@ fn an_empty_export_as_range_shows_an_example() {
assert!(text.lines().any(|l| l == "1-3, 5"), "{text}");
}
/// #5941: the Format list showed no scroll bar until the pointer came over it, so nothing told
/// the user that more formats lay below the last one shown, and it opened again where it was last
/// scrolled, with its first formats out of view. Opened with the pointer elsewhere and a format
/// near the end chosen, a list that does not show every format shows its bar, the chosen format shows
/// whole, and a list opened again after a scroll shows the same rows as when it first opened.
#[test]
fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format_in_view() {
fn walk(shape: &egui::Shape, clip: egui::Rect, texts: &mut Vec<(String, egui::Rect, egui::Rect)>, bars: &mut Vec<egui::Rect>) {
match shape {
egui::Shape::Text(t) => texts.push((t.galley.text().into(), t.visual_bounding_rect(), clip)),
egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect),
egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, clip, texts, bars)),
_ => {}
}
}
let labels: Vec<&str> = export_as::formats().iter().map(|f| f.label).collect();
// A built-in format six from the end of the built-in ones: out of view when the list opens at
// its top, and far enough from the end that a plug-in format another test adds after the
// built-in ones does not move the rows shown around it.
let built_in: Vec<_> = fileio::FORMATS.iter().filter(|f| f.write && !matches!(f.id, "vectorcraft" | "ai")).collect();
let chosen = built_in.len().checked_sub(6).and_then(|i| built_in.get(i)).copied().expect("Export As lists formats");
let (mut app, _) = app(1);
app.run("file.exportAs", json!({"format": chosen.id})).unwrap();
let ctx = egui::Context::default();
theme::install_fonts(&ctx);
theme::apply(&ctx, Default::default());
// Every scroll area takes the bar at rest from the theme, whatever style the list sets itself.
assert_eq!(ctx.global_style().spacing.scroll, crate::widgets::list_scroll_style());
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1024.0, 480.0)));
let mut time = 0.0;
let mut run = |app: &mut VectorcraftApp, events: Vec<egui::Event>| {
time += 0.25;
let mut out = ctx.run_ui(egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() }, |ui| show(app, ui.ctx()));
out.textures_delta.clear();
let (mut texts, mut bars) = (vec![], vec![]);
out.shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut texts, &mut bars));
(texts, bars)
};
let away = egui::Event::PointerMoved(egui::pos2(1.0, 1.0));
run(&mut app, vec![away.clone()]);
let (texts, _) = run(&mut app, vec![]);
let field = texts.iter().find(|(s, ..)| s == chosen.label).map(|(_, r, _)| r.center()).expect("the Format field shows the chosen format");
let click_at = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
// Opens the list, moves the pointer away and returns the list's rect, the format names drawn in
// it with their clip rects, and the bars drawn.
type Run<'r> = dyn FnMut(&mut VectorcraftApp, Vec<egui::Event>) -> (Vec<(String, egui::Rect, egui::Rect)>, Vec<egui::Rect>) + 'r;
let open = |run: &mut Run<'_>, app: &mut VectorcraftApp| {
run(app, vec![egui::Event::PointerMoved(field), click_at(field, true)]);
run(app, vec![click_at(field, false)]);
run(app, vec![away.clone()]);
let (mut texts, mut bars) = (vec![], vec![]);
for _ in 0..4 {
(texts, bars) = run(app, vec![]);
}
let list = ctx
.memory(|m| {
m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))
})
.expect("the Format list is open");
let rows: Vec<_> = texts.into_iter().filter(|(s, r, _)| labels.contains(&s.as_str()) && list.contains_rect(*r)).collect();
(list, rows, bars)
};
let whole = |rows: &[(String, egui::Rect, egui::Rect)], name: &str| {
rows.iter().any(|(s, r, clip)| s == name && r.top() >= clip.top() && r.bottom() <= clip.bottom())
};
let tops = |rows: &[(String, egui::Rect, egui::Rect)]| rows.iter().map(|(s, r, _)| (s.clone(), r.top().round())).collect::<Vec<_>>();
let (list, rows, bars) = open(&mut run, &mut app);
assert!(!rows.is_empty(), "the Format list is open");
assert!(whole(&rows, chosen.label), "the chosen format shows whole: {:?}", tops(&rows));
// A list that shows every format needs no bar; one that does not shows its bar.
if rows.len() < labels.len() {
assert!(
bars.iter().any(|b| list.contains_rect(*b) && b.left() > list.center().x),
"the list's scroll bar is drawn at rest in {list:?}: {bars:?}"
);
}
// Scrolled, closed and opened again, the list shows the rows it first opened with, not the
// offset it was scrolled to.
run(&mut app, vec![egui::Event::PointerMoved(list.center())]);
let wheel = egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Point,
delta: egui::vec2(0.0, 30.0),
modifiers: Default::default(),
phase: egui::TouchPhase::Move,
source: egui::MouseWheelSource::Unknown,
};
run(&mut app, vec![wheel]);
let mut scrolled = vec![];
for _ in 0..4 {
(scrolled, _) = run(&mut app, vec![]);
}
let scrolled: Vec<_> = scrolled.into_iter().filter(|(s, r, _)| labels.contains(&s.as_str()) && list.contains_rect(*r)).collect();
run(&mut app, vec![egui::Event::PointerMoved(field), click_at(field, true)]);
run(&mut app, vec![click_at(field, false)]);
let (_, reopened, _) = open(&mut run, &mut app);
if rows.len() < labels.len() {
assert_ne!(tops(&scrolled), tops(&rows), "the wheel scrolled the list");
}
assert_eq!(tops(&reopened), tops(&rows), "the reopened list shows the rows it first opened with");
assert!(whole(&reopened, chosen.label), "the chosen format shows whole: {:?}", tops(&reopened));
}
#[test]
fn svg_continues_in_svg_options() {
let (mut app, written) = app(2);
+3 -2
View File
@@ -1029,8 +1029,9 @@ fn tiff_dropdown_exports_scaled_artboards_with_options_and_reopens() {
// Existing vector and raster choices remain selectable.
h.choose(&mut app, "TIFF", "SVG");
assert_eq!(field(&app, "formats")[0]["format"], "svg");
h.choose(&mut app, "SVG", "PNG");
assert_eq!(field(&app, "formats")[0]["format"], "png");
// The list opens with SVG in its middle, so a raster format near it is in view.
h.choose(&mut app, "SVG", "GIF");
assert_eq!(field(&app, "formats")[0]["format"], "gif");
}
/// The Example line names the first file the export writes for the same settings: the item's file
+64
View File
@@ -8908,3 +8908,67 @@ variable-list-end {0}, {1} {0}, dan {1}
# #5804 native-picked raster editor (draft translations; native review welcome).
Edit Original with: Edit asli dengan:
file-filter Applications Aplikasi
# .cdr and .cmx import notes.
@msg CDR text, bitmaps, blends, contours, brush strokes and other objects VectorCraft doesn't read yet were left out teks, bitmap, blend, kontur, goresan kuas, dan objek CDR lain yang belum dibaca VectorCraft tidak disertakan
@msg CDR fountain, pattern, texture and PostScript fills were left out isian fountain, pola, tekstur, dan PostScript CDR tidak disertakan
@msg colors in CDR color models VectorCraft doesn't read were opened as black warna dalam model warna CDR yang tidak dibaca VectorCraft dibuka sebagai hitam
@msg CDR library colors that the drawing stores only by number were opened as black spot colors warna pustaka CDR yang disimpan gambar hanya berdasarkan nomor dibuka sebagai warna spot hitam
@msg CDR outline arrowheads were left out kepala panah garis luar CDR tidak disertakan
@msg CDR envelopes were not applied, and the shapes under them keep their outlines amplop CDR tidak diterapkan, dan bentuk di bawahnya mempertahankan garis luarnya
@msg CDR lenses and object transparency were not applied, and the objects they are on show opaque lensa dan transparansi objek CDR tidak diterapkan, dan objek tempatnya berada tampil buram
@msg parts of the drawing nested too deeply, or past the import limits, were left out bagian gambar yang bersarang terlalu dalam, atau melewati batas impor, tidak disertakan
@msg damaged parts of the drawing were left out bagian gambar yang rusak tidak disertakan
@msg CDR pages longer than 163,830 pt were opened at that length, and art near their edges lies outside the artboard halaman CDR yang lebih panjang dari 163.830 pt dibuka dengan panjang tersebut, dan karya di dekat tepinya berada di luar artboard
@msg CMX text, images, rectangles, ellipses, clipping paths and other objects VectorCraft doesn't read yet were left out teks, gambar, persegi panjang, elips, jalur kliping, dan objek CMX lain yang belum dibaca VectorCraft tidak disertakan
@msg CMX fills other than uniform colors were left out isian CMX selain warna seragam tidak disertakan
@msg colors in CMX color models VectorCraft doesn't read were opened as black warna dalam model warna CMX yang tidak dibaca VectorCraft dibuka sebagai hitam
@msg CMX library colors that the file stores only by number were opened as black spot colors warna pustaka CMX yang disimpan berkas hanya berdasarkan nomor dibuka sebagai warna spot hitam
@msg CMX outline arrowheads were left out kepala panah garis luar CMX tidak disertakan
@msg CMX lenses were not applied lensa CMX tidak diterapkan
@msg CMX pages longer than 163,830 pt were opened at that length, and art near their edges lies outside the artboard halaman CMX yang lebih panjang dari 163.830 pt dibuka dengan panjang tersebut, dan karya di dekat tepinya berada di luar artboard
# PSD import notes.
@msg the file is no longer loaded berkas tidak lagi dimuat
@msg 1 type layer came in as pixels: the text isn't editable 1 lapisan teks masuk sebagai piksel: teksnya tidak dapat disunting
@msg {n} type layers came in as pixels: the text isn't editable {n} lapisan teks masuk sebagai piksel: teksnya tidak dapat disunting
@msg 1 adjustment layer was not applied 1 lapisan penyesuaian tidak diterapkan
@msg {n} adjustment layers were not applied {n} lapisan penyesuaian tidak diterapkan
@msg 1 fill layer was not drawn (a gradient or pattern fill, a color that can't be read, or a shape that stores no pixels) 1 lapisan isian tidak digambar (isian gradien atau pola, warna yang tidak dapat dibaca, atau bentuk yang tidak menyimpan piksel)
@msg {n} fill layers were not drawn (a gradient or pattern fill, a color that can't be read, or a shape that stores no pixels) {n} lapisan isian tidak digambar (isian gradien atau pola, warna yang tidak dapat dibaca, atau bentuk yang tidak menyimpan piksel)
@msg the layer effects of 1 layer weren't drawn efek lapisan dari 1 lapisan tidak digambar
@msg the layer effects of {n} layers weren't drawn efek lapisan dari {n} lapisan tidak digambar
@msg the vector masks of 1 layer weren't applied masker vektor dari 1 lapisan tidak diterapkan
@msg the vector masks of {n} layers weren't applied masker vektor dari {n} lapisan tidak diterapkan
@msg the knockout of 1 layer wasn't applied knockout dari 1 lapisan tidak diterapkan
@msg the knockout of {n} layers wasn't applied knockout dari {n} lapisan tidak diterapkan
@msg 1 layer was left out (hidden layers and the layers clipped to them) 1 lapisan tidak disertakan (lapisan tersembunyi dan lapisan yang dikliping padanya)
@msg {n} layers were left out (hidden layers and the layers clipped to them) {n} lapisan tidak disertakan (lapisan tersembunyi dan lapisan yang dikliping padanya)
@msg 1 layer clipped to a fill layer that wasn't drawn was left out 1 lapisan yang dikliping ke lapisan isian yang tidak digambar tidak disertakan
@msg {n} layers clipped to fill layers that weren't drawn were left out {n} lapisan yang dikliping ke lapisan isian yang tidak digambar tidak disertakan
@msg layers in blend modes VectorCraft doesn't have ({modes}) were merged with the layers below them lapisan dalam mode campuran yang tidak dimiliki VectorCraft ({modes}) digabungkan dengan lapisan di bawahnya
@msg 1 layer in blend modes VectorCraft doesn't have came in as Normal: the merge needs more memory than allowed 1 lapisan dalam mode campuran yang tidak dimiliki VectorCraft masuk sebagai Normal: penggabungan memerlukan memori lebih dari yang diizinkan
@msg {n} layers in blend modes VectorCraft doesn't have came in as Normal: the merge needs more memory than allowed {n} lapisan dalam mode campuran yang tidak dimiliki VectorCraft masuk sebagai Normal: penggabungan memerlukan memori lebih dari yang diizinkan
@msg 1 layer clipped to the layer below came in unclipped: the merge needs more memory than allowed 1 lapisan yang dikliping ke lapisan di bawahnya masuk tanpa kliping: penggabungan memerlukan memori lebih dari yang diizinkan
@msg {n} layers clipped to the layer below came in unclipped: the merge needs more memory than allowed {n} lapisan yang dikliping ke lapisan di bawahnya masuk tanpa kliping: penggabungan memerlukan memori lebih dari yang diizinkan
@msg hiddenLayers applies to a PSD file placed with layers: true hiddenLayers berlaku untuk berkas PSD yang ditempatkan dengan layers: true
@msg importSlices: a linked PSD file is placed as its flat image; give link: false to embed it with its slices importSlices: berkas PSD tertaut ditempatkan sebagai gambar datarnya; berikan link: false untuk menyematkannya beserta irisannya
@msg layers: a linked PSD file is placed as its flat image; leave link out or give link: false layers: berkas PSD tertaut ditempatkan sebagai gambar datarnya; hilangkan link atau berikan link: false
@msg 1 slice lies outside the canvas or has no size and was left out 1 irisan berada di luar kanvas atau tidak berukuran dan tidak disertakan
@msg {n} slices lie outside the canvas or have no size and were left out {n} irisan berada di luar kanvas atau tidak berukuran dan tidak disertakan
@msg 1 slice would lie outside the canvas and was left out 1 irisan akan berada di luar kanvas dan tidak disertakan
@msg {n} slices would lie outside the canvas and were left out {n} irisan akan berada di luar kanvas dan tidak disertakan
@msg the slices' descriptor holds too many values deskriptor irisan menyimpan terlalu banyak nilai
@msg the slices' descriptor has a version other than 16 deskriptor irisan memiliki versi selain 16
@msg the slices' descriptor has no list of slices deskriptor irisan tidak memiliki daftar irisan
@msg the slices' descriptor lists something other than a slice deskriptor irisan mencantumkan sesuatu selain irisan
@msg a slice in the slices' descriptor has no bounds sebuah irisan dalam deskriptor irisan tidak memiliki batas
@msg a slice's bounds in the slices' descriptor aren't numbers batas sebuah irisan dalam deskriptor irisan bukan angka
@msg the slices' descriptor nests too deep deskriptor irisan bersarang terlalu dalam
@msg the slices can't be read ({e}) and were left out irisan tidak dapat dibaca ({e}) dan tidak disertakan
@msg the slices are stored in version {v}, which isn't read irisan disimpan dalam versi {v}, yang tidak dibaca
@msg the file has {count} slices, more than the {MAX_SLICES} read berkas memiliki {count} irisan, lebih dari {MAX_SLICES} yang dibaca
@msg a text in the slices has more than the {MAX_TEXT} characters read sebuah teks dalam irisan memiliki lebih dari {MAX_TEXT} karakter yang dibaca
@msg the slices' descriptor has a reference of an unknown kind ({_1}) deskriptor irisan memiliki referensi dengan jenis yang tidak dikenal ({_1})
@msg the slices' descriptor has a value of an unknown type ({_1}) deskriptor irisan memiliki nilai dengan tipe yang tidak dikenal ({_1})
@msg the layers can't be read ({e}): the file was placed as its merged image lapisan tidak dapat dibaca ({e}): berkas ditempatkan sebagai gambar gabungannya
Can't render this file because it is too large.
-1
View File
@@ -10425,7 +10425,6 @@ digits Hindi Hindi
@msg names is empty names är tom
@msg no artboard {artboard} (0-based; the document has {_1}) ingen rityta {artboard} (räknat från 0; dokumentet har {_1})
@msg no brush named `{n}` ingen pensel med namnet `{n}`
@msg no colour group `{group}` ingen färggrupp `{group}`
@msg no export preset `{name}` (see document.exportPresets.list) ingen exportförinställning `{name}` (se document.exportPresets.list)
@msg no formats to export inga format att exportera
@msg no perspective grid preset named `{n}` ingen förinställning för perspektivrutnät med namnet `{n}`
Can't render this file because it is too large.
+172 -9
View File
@@ -37,6 +37,8 @@ use crate::widgets::{self, menu_item};
/// (Zoom Out reduces the preview, Zoom In increases it). The step sizes themselves are ours.
const CELL_STEPS: [f32; 7] = [16.0, 22.0, 30.0, 42.0, 56.0, 72.0, 96.0];
const CELL_DEFAULT: usize = 2;
/// The least height of a grid's list that scrolls, when the panel leaves it less room.
const MIN_LIST_H: f32 = 64.0;
/// The grid step in [`crate::state::UiState::glyphs_preview`]. `0` means [`CELL_DEFAULT`]; a
/// stored step is `index + 1`. A value past the steps (a hand-edited preferences file) is the
@@ -61,6 +63,26 @@ fn nudge_cell(index: usize, delta: i32) -> usize {
(index as i32 + delta).clamp(0, last) as usize
}
/// The cells in a row of a grid `w` wide that holds `count` cells of side `cell` in a list at most
/// `list_h` tall. When the rows run past the list, its scroll bar takes a column of its own and the
/// cells go beside it; when they fit, the cells take the whole width.
fn grid_cols(ui: &Ui, w: f32, cell: f32, count: usize, list_h: f32) -> usize {
let fit = |room: f32| ((room / cell).floor() as usize).max(1);
let gap = ui.spacing().item_spacing.y;
let cols = fit(w);
// The height `ScrollArea::show_rows` gives the rows: the gaps between them, none after the last.
let content_h = count.div_ceil(cols) as f32 * (row_height(ui, cell) + gap) - gap;
// The list is as tall as the room left, but at least as tall as `min_scrolled_height` makes it.
let view_h = list_h.min(ui.available_height().max(list_h.min(MIN_LIST_H)));
if view_h.ceil() < content_h { fit(w - ui.spacing().scroll.allocated_width()) } else { cols }
}
/// The height of a row of cells of side `cell`: a row laid out with `Ui::horizontal` is at least as
/// tall as a button, so the two smallest cell sizes give rows taller than their cells.
fn row_height(ui: &Ui, cell: f32) -> f32 {
cell.max(ui.spacing().interact_size.y)
}
/// Character subsets offered by the Show menu.
const SUBSETS: [(&str, u32, u32); 7] = [
("Entire Font", 0, 0x10FFFF),
@@ -372,10 +394,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
let (chars, unencoded) = grid_glyphs(&face, category.and_then(|i| face.glyph_categories().get(i)), subset, (lo, hi));
let total = chars.len() + unencoded.len();
let cell = CELL_STEPS[cell_index(app)];
let cols = ((w / cell).floor() as usize).max(1);
let rows = total.div_ceil(cols);
let px = (cell * ui.ctx().pixels_per_point()).round().clamp(8.0, 256.0) as u32;
let list_h = widgets::panel_list_height(ui, (ui.available_height() - 64.0).max(cell * 3.0), 33.0);
let cols = grid_cols(ui, w, cell, total, list_h);
let rows = total.div_ceil(cols);
let hover_id = egui::Id::unique("gl-hover");
let selected = selected_char(app);
// What a double-click on an unencoded glyph can do to the selected character.
@@ -384,20 +406,20 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
// only when the selection moves to another character, so it still scrolls freely meanwhile.
let follow_id = egui::Id::unique("gl-follow");
let (followed, shown): (Option<char>, std::ops::Range<usize>) = ui.ctx().data(|d| d.get_temp(follow_id)).unwrap_or_default();
let mut area = egui::ScrollArea::vertical().max_height(list_h).min_scrolled_height(list_h.min(64.0)).auto_shrink([false, false]);
let mut area = egui::ScrollArea::vertical().max_height(list_h).min_scrolled_height(list_h.min(MIN_LIST_H)).auto_shrink([false, false]);
if selected != followed
&& let Some(c) = selected
&& let Ok(i) = chars.binary_search_by_key(&c, |x| x.0)
&& !shown.contains(&(i / cols))
{
let row_h = cell + ui.spacing().item_spacing.y;
let row_h = row_height(ui, cell) + ui.spacing().item_spacing.y;
area = area.vertical_scroll_offset((((i / cols) as f32 + 0.5) * row_h - list_h * 0.5).max(0.0));
}
// A pick in a cell's pop-up of alternates: the character (none for a glyph no character maps),
// the glyph of its cell, the glyph picked.
let mut popup_pick: Option<(Option<char>, u32, u32)> = None;
let shown =
area.show_rows(ui, cell, rows, |ui, range| {
area.show_rows(ui, row_height(ui, cell), rows, |ui, range| {
for r in range.clone() {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing = vec2(0.0, 0.0);
@@ -603,18 +625,18 @@ fn alternates(app: &mut VectorcraftApp, ui: &mut Ui, w: f32) {
default: false,
}));
let cell = CELL_STEPS[cell_index(app)];
let cols = ((w / cell).floor() as usize).max(1);
let rows = list.len().div_ceil(cols);
let px = (cell * ui.ctx().pixels_per_point()).round().clamp(8.0, 256.0) as u32;
let list_h = widgets::panel_list_height(ui, (ui.available_height() - 64.0).max(cell * 3.0), 33.0);
let cols = grid_cols(ui, w, cell, list.len(), list_h);
let rows = list.len().div_ceil(cols);
let mut pick = None;
// A scroll position of its own for each character, so the grid starts at the top for another.
let area = egui::ScrollArea::vertical()
.id_salt(("gl-alternates", id.0, byte))
.max_height(list_h)
.min_scrolled_height(list_h.min(64.0))
.min_scrolled_height(list_h.min(MIN_LIST_H))
.auto_shrink([false, false]);
area.show_rows(ui, cell, rows, |ui, range| {
area.show_rows(ui, row_height(ui, cell), rows, |ui, range| {
for r in range {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing = vec2(0.0, 0.0);
@@ -2476,6 +2498,147 @@ mod tests {
assert_eq!(app.session.active().unwrap().history.undo.len(), undo + 1, "one undo step");
}
/// The panel drawn `width` by `height` after a few frames (the scroll bar fades in): the left
/// edge of its scroll bar, when one is drawn, the grid's cells and the rectangle they are
/// clipped to.
fn grid_with_bar(ctx: &egui::Context, app: &mut VectorcraftApp, width: f32, height: f32, time: &mut f64) -> (Option<f32>, Vec<Rect>, Rect) {
fn flat(s: Shape, out: &mut Vec<Shape>) {
match s {
Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)),
s => out.push(s),
}
}
let mut shapes = vec![];
let mut clip = Rect::NOTHING;
for _ in 0..4 {
*time += 0.5;
let raw =
egui::RawInput { time: Some(*time), screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(width, height))), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
out.textures_delta.clear();
shapes.clear();
for c in out.shapes {
if !squares(std::slice::from_ref(&c.shape)).is_empty() {
clip = c.clip_rect;
}
flat(c.shape, &mut shapes);
}
}
// The bar's track and handle: narrow filled rectangles taller than a cell.
let bar = shapes
.iter()
.filter_map(|s| match s {
Shape::Rect(r) if r.fill != Color32::TRANSPARENT && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => Some(r.rect.left()),
_ => None,
})
.min_by(f32::total_cmp);
(bar, squares(&shapes), clip)
}
/// #5941: the grid's cells go beside its scroll bar. At every panel width the bar shows and the
/// last cell of a row ends before it.
#[test]
fn the_grids_cells_end_before_its_scroll_bar() {
use vectorcraft_text::test_fonts::{JOINING_ALTERNATES_FAMILY, joining_alternates_font};
FontDb::global().add_font(joining_alternates_font().expect("the test font builds"));
let (mut app, id) = editing("\u{628}");
app.run("text.setRangeStyle", json!({"id": id, "font": JOINING_ALTERNATES_FAMILY})).unwrap();
let ctx = egui::Context::default();
crate::theme::apply(&ctx, Default::default());
let mut time = 0.0;
for width in 240..=300 {
let (bar, cells, _) = grid_with_bar(&ctx, &mut app, width as f32, 420.0, &mut time);
// Cells wider than the room beside the bar push the bar past the panel's edge.
let Some(bar) = bar else { panic!("width {width}: the grid scrolls and shows its bar") };
assert!(!cells.is_empty(), "width {width}: the grid is drawn");
let last = cells.iter().map(|r| r.right()).fold(f32::MIN, f32::max);
assert!(last <= bar - 1.0, "width {width}: the last cell ends at {last}, the bar starts at {bar}");
}
}
/// #5941: Alternates for Current Selection lays out its cells the same way. While its rows run
/// past the list, the cells end before the scroll bar; while they fit, no bar shows and the
/// cells fill the whole width.
#[test]
fn the_alternates_grid_leaves_room_for_its_scroll_bar_only_while_it_scrolls() {
use vectorcraft_text::test_fonts::{alternates_family, alternates_font};
FontDb::global().add_font(alternates_font(true).expect("the test font builds"));
let (mut app, id) = editing("xay");
app.run("text.setRangeStyle", json!({"id": id, "font": alternates_family(true)})).unwrap();
select(&mut app, 2, 2);
let ctx = egui::Context::default();
crate::theme::apply(&ctx, Default::default());
set_pstate(&ctx, "gl-subset", SUBSETS.len());
let mut time = 0.0;
let (mut scrolled, mut fitted) = (0, 0);
// The largest cells, so seven glyphs fill two to four rows. In a panel 360 pt tall, three
// rows of them run past the list; in one 640 pt tall, they fit. The sweep covers panel
// widths at three heights, then the heights around the one where three rows just fit.
let cell = CELL_STEPS[CELL_STEPS.len() - 1];
set_cell_index(&mut app, CELL_STEPS.len() - 1);
let sizes = [360, 420, 640].into_iter().flat_map(|h| (240..=320).map(move |w| (w, h))).chain((360..=420).map(|h| (290, h)));
for (width, height) in sizes {
let (bar, cells, clip) = grid_with_bar(&ctx, &mut app, width as f32, height as f32, &mut time);
assert!(!cells.is_empty(), "{width}×{height}: the grid is drawn");
let last = cells.iter().map(|r| r.right()).fold(f32::MIN, f32::max);
let left = cells.iter().map(|r| r.left()).fold(f32::MAX, f32::min);
let row = cells.iter().filter(|r| (r.top() - cells[0].top()).abs() < 1.0).count();
// The cells a row holds across the whole width.
let room = (((width as f32 - 2.0 * left) / cell).floor() as usize).clamp(1, 7);
if let Some(bar) = bar {
scrolled += 1;
assert!(last <= bar - 1.0, "{width}×{height}: the last cell ends at {last}, the bar starts at {bar}");
// Rows narrowed for the bar only when full-width rows would not fit either.
if row < room {
let step = cells.iter().map(|r| r.top() - cells[0].top()).filter(|d| *d > 1.0).fold(f32::MAX, f32::min);
let full = 7usize.div_ceil(room) as f32 * step - (step - cell);
assert!(full > clip.height() + 0.5, "{width}×{height}: {room} to a row would fit in {full} pt, the list is {}", clip.height());
}
} else {
fitted += 1;
// Without a bar every cell shows whole; a grid that runs past its list would need one.
assert_eq!(cells.len(), 7, "{width}×{height}: a and its six alternates all show");
let bottom = cells.iter().map(|r| r.bottom()).fold(f32::MIN, f32::max);
assert!(
bottom <= clip.bottom() + 0.5 && last <= clip.right() + 0.5,
"{width}×{height}: the cells end at ({last}, {bottom}), inside the list {clip:?}"
);
assert_eq!(row, room, "{width}×{height}: without a bar a row takes the whole width (cells from {left})");
}
}
assert!(scrolled > 0 && fitted > 0, "both layouts are drawn: {scrolled} scrolled, {fitted} fitted");
}
/// #5941: at the smallest cell sizes a row of the grid is as tall as a button, taller than its
/// cells. A list tall enough for four rows of cells but not for four rows as drawn scrolls, so
/// its cells go beside the bar, at a width that holds a whole number of cells too.
#[test]
fn small_cells_leave_room_for_the_bar_when_their_rows_as_drawn_run_past_the_list() {
let ctx = egui::Context::default();
crate::theme::apply(&ctx, Default::default());
let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(800.0, 800.0))), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| {
let gap = ui.spacing().item_spacing.y;
let bar = ui.spacing().scroll.allocated_width();
for cell in [CELL_STEPS[0], CELL_STEPS[1]] {
let drawn = ui.spacing().interact_size.y;
assert!(drawn > cell, "{cell} pt cells: rows are {drawn} pt as drawn");
let w = 6.0 * cell;
// Four rows of six: they fit at the cells' own height, not at the rows' drawn height.
let list_h = 4.0 * (cell + drawn) / 2.0 + 3.0 * gap;
let beside = ((w - bar) / cell).floor() as usize;
assert_eq!(grid_cols(ui, w, cell, 24, list_h), beside, "{cell} pt cells in a list {list_h} pt tall");
}
// With less room left than the list's least height, the list is that tall: two rows of
// twelve 22 pt cells fit in it, so they take the whole width.
let w = 12.0 * CELL_STEPS[1];
ui.allocate_ui(vec2(w, 48.0), |ui| {
assert_eq!(grid_cols(ui, w, CELL_STEPS[1], 24, 66.0), 12, "two rows in a 64 pt list with 48 pt of room");
});
});
out.textures_delta.clear();
}
/// Show › Entire Font also lists the glyphs no character maps.
#[test]
fn entire_font_lists_the_unencoded_glyphs() {
+47
View File
@@ -186,6 +186,53 @@ fn app() -> VectorcraftApp {
VectorcraftApp::new(Session::new(), Services::default())
}
/// #5941: a page whose settings run past the bottom of the list showed no scroll bar, so a setting
/// lower on the page was easy to miss. Every page that scrolls shows its bar inside the window, and
/// no label is cut off at the side.
#[test]
fn a_page_that_scrolls_shows_its_bar() {
fn walk(shape: &egui::Shape, clip: egui::Rect, texts: &mut Vec<(String, egui::Rect, egui::Rect)>, bars: &mut Vec<egui::Rect>) {
match shape {
egui::Shape::Text(t) if !t.galley.text().trim().is_empty() => texts.push((t.galley.text().into(), t.visual_bounding_rect(), clip)),
egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect),
egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, clip, texts, bars)),
_ => {}
}
}
let mut scrolled = 0;
for cat in PREF_CATEGORIES {
let mut a = app();
open(&mut a, Some(cat));
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
crate::theme::apply(&ctx, Default::default());
let (mut texts, mut bars) = (vec![], vec![]);
for time in [0.0, 0.25, 0.5, 0.75] {
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 900.0)));
let raw = egui::RawInput { screen_rect, time: Some(time), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| show(&mut a, ui.ctx()));
out.textures_delta.clear();
(texts, bars) = (vec![], vec![]);
out.shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut texts, &mut bars));
}
let window = ctx.memory(|m| m.area_rect(egui::Id::unique("dialog-preferences"))).expect("the dialog window is shown");
// A label below its clip: the page runs past the bottom of the list.
let scrolls = texts.iter().any(|(_, r, clip)| window.contains_rect(*clip) && r.top() >= clip.bottom());
if scrolls {
scrolled += 1;
assert!(bars.iter().any(|b| window.contains_rect(*b)), "{cat}: the page scrolls and its bar shows in {window:?}: {bars:?}");
}
let cut: Vec<_> = texts
.iter()
.filter(|(_, r, clip)| clip.y_range().contains(r.center().y) && (r.left() < clip.left() - 1.0 || r.right() > clip.right() + 1.0))
.filter(|(_, r, _)| window.intersects(*r))
.map(|(s, r, clip)| format!("{s:?} {r:?} in {clip:?}"))
.collect();
assert!(cut.is_empty(), "{cat}: labels cut off at the side: {cut:?}");
}
assert!(scrolled > 0, "at least one page runs past the bottom of its list");
}
#[test]
fn dialog_ok_applies_prefs_and_ui_fields() {
let mut a = app();
+3
View File
@@ -648,6 +648,9 @@ pub fn apply_with(ctx: &egui::Context, b: Brightness, accent: Accent, scheme: Sc
s.spacing.interact_size = egui::vec2(24.0, 24.0);
s.spacing.menu_margin = egui::Margin::same(6);
s.spacing.slider_width = 120.0;
// Every scroll area shows its bar while it has more to show, in a column of its own,
// not only while the pointer is over it (#5941).
s.spacing.scroll = crate::widgets::list_scroll_style();
s.text_styles = [
(TextStyle::Small, FontId::proportional(11.0)),
(TextStyle::Body, FontId::proportional(13.0)),
+88 -7
View File
@@ -27,7 +27,7 @@ pub fn dropdown_names_named(ui: &mut Ui, id: impl std::hash::Hash, name: Option<
combo_named(ui, id, name, current, width, |ui| {
let mut chosen = None;
for (i, o) in options.iter().enumerate() {
if ui.add(egui::Button::selectable(*o == current, *o)).clicked() {
if option_row(ui, true, *o == current, *o).clicked() {
chosen = Some(i);
}
}
@@ -75,7 +75,7 @@ pub fn dropdown_icon_names_sized(
let mut chosen = None;
for (i, o) in options.iter().enumerate() {
let on = current == Some(i);
if ui.add(egui::Button::selectable(on, (atom(i, on), *o))).clicked() {
if option_row(ui, true, on, (atom(i, on), *o)).clicked() {
chosen = Some(i);
}
}
@@ -109,7 +109,7 @@ pub fn dropdown_with_named(
combo_named(ui, id, name, tl!(current), width, |ui| {
let mut chosen = None;
for (i, o) in options.iter().enumerate() {
if ui.add_enabled(enabled(i), egui::Button::selectable(*o == current, tl!(o))).clicked() {
if option_row(ui, enabled(i), *o == current, tl!(o)).clicked() {
chosen = Some(i);
}
}
@@ -117,6 +117,38 @@ pub fn dropdown_with_named(
})
}
/// What [`option_row`] found in a list that [`combo_atoms_named`] draws on the pass the list opens
/// and the pass after it.
#[derive(Clone, Copy, Default)]
struct Opening {
/// The list draws its options with [`option_row`].
rows: bool,
/// A current option was scrolled into view.
scrolled: bool,
}
thread_local! {
/// The [`Opening`] that [`combo_atoms_named`] keeps while it draws a list on the pass the list
/// opens and the pass after it; `None` otherwise. A row reads it without a lookup in the
/// context's data.
static OPENING: std::cell::Cell<Option<Opening>> = const { std::cell::Cell::new(None) };
}
/// One option of a dropdown list, `selected` for the current one. On the pass the list opens and
/// the next one, the first current option scrolls to the middle of the list, or as near to it as
/// the list's ends allow, so that it shows whole (#5941).
fn option_row<'a>(ui: &mut Ui, enabled: bool, selected: bool, atoms: impl egui::IntoAtoms<'a>) -> Response {
let response = ui.add_enabled(enabled, egui::Button::selectable(selected, atoms));
if let Some(opening) = OPENING.get() {
let scroll = selected && !opening.scrolled;
if scroll {
ui.scroll_to_rect_animation(response.rect, Some(egui::Align::Center), egui::style::ScrollAnimation::none());
}
OPENING.set(Some(Opening { rows: true, scrolled: opening.scrolled || scroll }));
}
response
}
/// The id [`craft_ui::ComboBox::from_id_salt`] gives its button in this `Ui`: `from_id_salt`
/// stores `IdSalt::new(salt)` and hashes it once more with the scope, so the app must hash `id`
/// the same way to read the button's focus and open state before it is drawn.
@@ -159,6 +191,52 @@ fn combo_atoms_named<'a, R>(
.corner_radius(CornerRadius::same(3))
.show(ui, |ui| {
let button_id = combo_button_id(ui, &id);
// A list whose options are `option_row`s opens with its current option in view, or at
// its first option, not where it was scrolled when it last closed (#5941). A list that
// draws its own rows has no current option to show, and opens where it was scrolled
// when it last closed.
let shown_key = button_id.with("list-shown-pass");
let opened_key = button_id.with("list-opened-pass");
let offset_key = button_id.with("list-offset");
let list = move |ui: &mut Ui| {
let pass = ui.ctx().cumulative_pass_nr();
let last = ui.data_mut(|d| d.get_temp::<u64>(shown_key));
ui.data_mut(|d| d.insert_temp(shown_key, pass));
let opening = last.is_none_or(|p| p + 1 < pass);
if opening {
ui.data_mut(|d| d.insert_temp(opened_key, pass));
}
// The menu measures itself against the whole screen on the pass it opens and takes
// the room beside its field on the next one, so the current option is scrolled into
// view on both.
let settling = ui.data(|d| d.get_temp::<u64>(opened_key)).is_some_and(|p| pass <= p + 1);
// A list drawn inside this one's rows finds its own record, and this one's comes back after it.
let outer = if settling { OPENING.replace(Some(Opening::default())) } else { OPENING.take() };
let (content_left, content_top) = (ui.max_rect().left(), ui.max_rect().top());
let at = move |y: f32| Rect::from_min_size(egui::pos2(content_left, content_top + y), Vec2::ZERO);
let chosen = list(ui);
let found = OPENING.replace(outer).unwrap_or_default();
let none = egui::style::ScrollAnimation::none();
if settling {
if found.rows {
if opening && !found.scrolled {
ui.scroll_to_rect_animation(at(0.0), Some(egui::Align::TOP), none);
}
} else {
// The list is taller on the pass it opens than beside its field, and egui
// clamps the scroll to the taller list, so the scroll it had when it closed
// is put back on both passes. A scroll area leaves an item spacing above a
// target aligned to its top, so the target is that much below the scroll.
let saved = ui.data(|d| d.get_temp::<f32>(offset_key)).unwrap_or(0.0);
ui.scroll_to_rect_animation(at(saved + ui.spacing().item_spacing.y), Some(egui::Align::TOP), none);
}
}
if !settling || chosen.is_some() {
// The scroll while the list is open: the content's top is above the clip's by it.
ui.data_mut(|d| d.insert_temp(offset_key, (ui.clip_rect().top() - content_top).max(0.0)));
}
chosen
};
let enter_for_combo = ui.memory(|m| m.has_focus(button_id)) || craft_ui::ComboBox::is_open(ui.ctx(), button_id);
let response = craft_ui::ComboBox::from_id_salt(HashOnly(&id))
.selected_text(current)
@@ -381,6 +459,8 @@ pub(crate) fn menu_room_either(below: f32, above: f32, tallest: f32) -> f32 {
/// The scroll bar of a menu's list: slim, in a column of its own beside the items, so it never
/// covers what sits at their right end (shortcuts, submenu arrows, a font's favourite star).
/// `theme::apply` makes it the style of every scroll area that does not set its own, so the bar
/// shows whenever there is more to scroll to (#5941).
pub fn list_scroll_style() -> egui::style::ScrollStyle {
egui::style::ScrollStyle { bar_width: 6.0, bar_inner_margin: 2.0, ..egui::style::ScrollStyle::solid() }
}
@@ -573,18 +653,19 @@ fn show_shortened_rows(ui: &Ui, painted: usize) {
}
/// A column of tool or panel buttons (the toolbar, the dock's icon column) that scrolls when the
/// window is too short for it: with the mouse wheel, or the scroll bar shown while the pointer is
/// over it.
/// window is too short for it: with the mouse wheel, or with its scroll bar.
/// Its scroll bar stays a slim line at the edge, even while scrolled or dragged, so it never covers
/// the buttons (#808).
/// the buttons (#808). The line shows while the pointer is elsewhere too (#5941).
pub fn strip_scroll<R>(ui: &mut Ui, id: &str, add_contents: impl FnOnce(&mut Ui) -> R) -> R {
ui.scope(|ui| {
let floating = egui::style::ScrollStyle::floating();
ui.spacing_mut().scroll = egui::style::ScrollStyle {
bar_width: 4.0,
floating_width: 2.0,
bar_inner_margin: 0.0,
bar_outer_margin: 1.0,
..egui::style::ScrollStyle::floating()
dormant_handle_opacity: floating.active_handle_opacity,
..floating
};
egui::ScrollArea::vertical().id_salt(id).auto_shrink([false, true]).show(ui, add_contents).inner
})
+279
View File
@@ -67,6 +67,285 @@ fn the_strip_scroll_bar_stays_a_slim_line_while_the_pointer_is_on_it() {
assert!(widest > 0.0, "the scroll bar is drawn");
assert!(widest <= 4.5, "the scroll bar is {widest} points wide");
}
/// The filled rectangles of a scroll bar drawn at the right of `content` in `shapes`: narrow
/// rectangles that start at or past the content's right edge.
fn bar_rects(shapes: &[egui::Shape], content: Rect, widest: f32) -> Vec<(Rect, Color32)> {
shapes
.iter()
.filter_map(|s| match s {
egui::Shape::Rect(r)
if r.fill != Color32::TRANSPARENT && r.rect.width() <= widest && r.rect.height() > 4.0 && r.rect.min.x >= content.right() - 0.5 =>
{
Some((r.rect, r.fill))
}
_ => None,
})
.collect()
}
// Regression test for #5941: a scrolling list in a panel or a dialog showed no scroll bar until the
// pointer came over it, so nothing told the user that the list had more rows. In every brightness
// the bar shows while the pointer is elsewhere, in a column of its own beside the rows, and its
// handle stands out from its track.
#[test]
fn a_scroll_bar_shows_while_the_pointer_is_elsewhere() {
for brightness in theme::Brightness::ALL {
let ctx = themed(brightness);
let rows = std::cell::Cell::new(Rect::NOTHING);
let mut add = |ui: &mut Ui| {
ui.allocate_ui(vec2(160.0, 200.0), |ui| {
egui::ScrollArea::vertical().id_salt("list").auto_shrink([false, false]).show(ui, |ui| {
for i in 0..40 {
ui.label(format!("Row {i}"));
}
rows.set(ui.max_rect());
});
});
};
frame(&ctx, 0.0, vec![egui::Event::PointerMoved(pos2(500.0, 350.0))], &mut add);
let shapes = frame(&ctx, 1.0, vec![], &mut add);
let rows = rows.get();
assert!(rows.width() < 160.0, "{brightness:?}: the rows leave a column for the bar: {rows:?}");
let bar = bar_rects(&shapes, rows, 10.0);
let (Some(track), Some(handle)) =
(bar.iter().max_by(|a, b| a.0.height().total_cmp(&b.0.height())), bar.iter().min_by(|a, b| a.0.height().total_cmp(&b.0.height())))
else {
panic!("{brightness:?}: the scroll bar is drawn at rest: {bar:?}");
};
assert!(handle.0.height() < track.0.height(), "{brightness:?}: a handle on a track: {bar:?}");
assert_eq!(handle.1.a(), 255, "{brightness:?}: the handle is opaque: {:?}", handle.1);
let gap = (i32::from(handle.1.r()) - i32::from(track.1.r())).abs();
assert!(gap >= 24, "{brightness:?}: handle {:?} on track {:?}", handle.1, track.1);
}
}
// Regression test for #5941: a drop-down list opens with its current option in view. With its field
// in the middle of a short window, neither side has room for the list's 200 pt, and the menu is cut
// to the room beside the field; the current option still shows whole, at the end of the list and in
// its middle, also when the room beside the field is less than half the list.
#[test]
fn a_dropdown_in_a_short_window_opens_with_its_current_option_in_view() {
let items: Vec<String> = (0..20).map(|i| format!("Option {i:02}")).collect();
let labels: Vec<&str> = items.iter().map(String::as_str).collect();
// (window height, space above the field, current option): about 105 pt and 65 pt on either side
// of the field.
for (height, above, current) in [(260.0, 117.0, 19), (260.0, 117.0, 10), (180.0, 77.0, 10), (180.0, 77.0, 3)] {
let ctx = themed(Default::default());
let field = std::cell::Cell::new(Rect::NOTHING);
let mut add = |ui: &mut Ui| {
ui.add_space(above);
field.set(ui.horizontal(|ui| dropdown_names(ui, "short-list", labels[current], &labels, 160.0)).response.rect);
};
let mut run = |time: f64, events: Vec<egui::Event>| {
let raw = egui::RawInput {
time: Some(time),
screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(600.0, height))),
events,
..Default::default()
};
let mut out = ctx.run_ui(raw, &mut add);
out.textures_delta.clear();
out.shapes
};
run(0.0, vec![]);
let at = field.get().center();
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
run(0.1, vec![egui::Event::PointerMoved(at), press(true)]);
run(0.2, vec![press(false)]);
let mut clipped = vec![];
for i in 3..10 {
clipped = run(f64::from(i) * 0.1, vec![]);
}
// Each shape with the clip rect it is painted in.
let mut shapes = vec![];
fn flat(s: egui::Shape, clip: Rect, out: &mut Vec<(egui::Shape, Rect)>) {
match s {
egui::Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, clip, out)),
s => out.push((s, clip)),
}
}
clipped.into_iter().for_each(|c| flat(c.shape, c.clip_rect, &mut shapes));
let list = ctx
.memory(|m| {
m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))
})
.expect("the list is open");
// The options that show whole: inside the list and inside the clip they are painted in.
let rows: Vec<(String, Rect)> = shapes
.iter()
.filter_map(|(s, clip)| match s {
egui::Shape::Text(t) if list.contains_rect(t.visual_bounding_rect()) && clip.contains_rect(t.visual_bounding_rect()) => {
Some((t.galley.text().to_owned(), t.visual_bounding_rect()))
}
_ => None,
})
.collect();
let case = format!("{height} pt window, {} current", labels[current]);
assert!(rows.len() < labels.len(), "{case}: the list does not show every option in {list:?}: {rows:?}");
assert!(rows.iter().any(|(s, _)| s == labels[current]), "{case}: the current option shows whole in {list:?}: {rows:?}");
}
}
// #5941: a drop-down list that draws its own rows (warp styles, tracing presets) has no current
// option for the drop-down to scroll to, so it opens where it was scrolled when it last closed, and
// a row picked below the first ones is still in view when the list opens again. That holds for a
// field in the middle of a short window too, where the list is taller on the pass it opens than
// beside the field, and for a list scrolled to its end.
#[test]
fn a_dropdown_that_draws_its_own_rows_opens_where_it_was_scrolled() {
// (window height, space above the field, wheel, a row the wheel brings into view)
for (height, above, wheel, row) in [(300.0, 20.0, -300.0, "Row 15"), (260.0, 117.0, -2000.0, "Row 19")] {
own_rows_reopen(height, above, wheel, row);
}
}
fn own_rows_reopen(height: f32, above: f32, wheel: f32, row: &str) {
let case = format!("{height} pt window, {above} pt above the field");
let items: Vec<String> = (0..20).map(|i| format!("Row {i:02}")).collect();
let ctx = themed(Default::default());
let field = std::cell::Cell::new(Rect::NOTHING);
let current = std::cell::RefCell::new(String::from("Row 00"));
let mut add = |ui: &mut Ui| {
ui.add_space(above);
let shown = current.borrow().clone();
let r = ui.horizontal(|ui| {
combo(ui, "own-rows", &shown, 160.0, |ui| {
let mut chosen = None;
for (i, s) in items.iter().enumerate() {
if ui.selectable_label(*s == shown, s.as_str()).clicked() {
chosen = Some(i);
}
}
chosen
})
});
if let Some(i) = r.inner {
current.replace(items[i].clone());
}
field.set(r.response.rect);
};
let mut time = 0.0;
let mut run = |events: Vec<egui::Event>| {
time += 0.1;
let raw = egui::RawInput {
time: Some(time),
screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(600.0, height))),
events,
..Default::default()
};
let mut out = ctx.run_ui(raw, &mut add);
out.textures_delta.clear();
out.shapes
};
// The rows that show whole, with their tops: inside the open list and the clip they are painted
// in.
let rows = |clipped: Vec<egui::epaint::ClippedShape>| -> Vec<(String, f32)> {
let list = ctx
.memory(|m| {
m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))
})
.expect("the list is open");
let mut shapes = vec![];
fn flat(s: egui::Shape, clip: Rect, out: &mut Vec<(egui::Shape, Rect)>) {
match s {
egui::Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, clip, out)),
s => out.push((s, clip)),
}
}
clipped.into_iter().for_each(|c| flat(c.shape, c.clip_rect, &mut shapes));
shapes
.iter()
.filter_map(|(s, clip)| match s {
egui::Shape::Text(t) if list.contains_rect(t.visual_bounding_rect()) && clip.contains_rect(t.visual_bounding_rect()) => {
Some((t.galley.text().to_owned(), t.visual_bounding_rect().top().round()))
}
_ => None,
})
.collect()
};
let has = |rows: &[(String, f32)], name: &str| rows.iter().any(|(s, _)| s == name);
run(vec![]);
let at = field.get().center();
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
let open = |run: &mut dyn FnMut(Vec<egui::Event>) -> Vec<egui::epaint::ClippedShape>| {
run(vec![egui::Event::PointerMoved(at), press(true)]);
run(vec![press(false)]);
let mut clipped = vec![];
for _ in 0..4 {
clipped = run(vec![]);
}
clipped
};
let first = rows(open(&mut run));
assert!(has(&first, "Row 00") && !has(&first, row), "{case}: the list opens at its top: {first:?}");
// Scrolled down to `row` and closed.
let list = ctx
.memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id)))
.expect("the list is open");
run(vec![egui::Event::PointerMoved(list.center())]);
let wheel = egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Point,
delta: vec2(0.0, wheel),
modifiers: Default::default(),
phase: egui::TouchPhase::Move,
source: egui::MouseWheelSource::Unknown,
};
run(vec![wheel]);
let mut clipped = vec![];
for _ in 0..4 {
clipped = run(vec![]);
}
let scrolled = rows(clipped);
assert!(has(&scrolled, row), "{case}: the wheel scrolls {row} into view: {scrolled:?}");
// Closed and opened again twice: each time its rows are where they were when it closed.
for time in ["first", "second"] {
run(vec![egui::Event::PointerMoved(at), press(true)]);
run(vec![press(false)]);
run(vec![]);
let reopened = rows(open(&mut run));
assert_eq!(reopened, scrolled, "{case}: the list opens again where it was scrolled, the {time} time");
}
// `row` picked: the field shows it, and the list opens again where it was when it was picked.
let top = scrolled.iter().find(|(s, _)| s == row).map(|(_, top)| *top).expect("the row shows");
let on_row = pos2(list.left() + 30.0, top + 6.0);
let click = |pressed| egui::Event::PointerButton { pos: on_row, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
run(vec![egui::Event::PointerMoved(on_row), click(true)]);
run(vec![click(false)]);
run(vec![]);
assert_eq!(*current.borrow(), row, "{case}: the click picks {row}");
let reopened = rows(open(&mut run));
assert_eq!(reopened, scrolled, "{case}: the list opens again where {row} was picked");
}
// Regression test for #5941: the toolbar's and the dock icon column's scroll bar showed nothing
// until the pointer came over the column. Its slim line shows at rest, still at most 4 points
// wide (#808).
#[test]
fn the_strip_scroll_bar_shows_while_the_pointer_is_elsewhere() {
let ctx = themed(Default::default());
let column = std::cell::Cell::new(Rect::NOTHING);
let mut add = |ui: &mut Ui| {
column.set(
ui.allocate_ui(vec2(80.0, 200.0), |ui| {
strip_scroll(ui, "strip", |ui| {
for i in 0..40 {
ui.label(format!("Tool {i}"));
}
});
})
.response
.rect,
);
};
frame(&ctx, 0.0, vec![egui::Event::PointerMoved(pos2(500.0, 350.0))], &mut add);
let shapes = frame(&ctx, 1.0, vec![], &mut add);
let column = column.get();
// The bar lies along the column's right edge, inside it.
let buttons = Rect::from_min_max(column.min, pos2(column.right() - 6.0, column.bottom()));
let bar = bar_rects(&shapes, buttons, 4.5);
assert!(!bar.is_empty(), "the slim scroll bar is drawn at rest");
}
// Regression test for #900: a number field with a spinner and a preset list drew as three
// boxes side by side: its text box was a point taller than the 26-point row, and each joint had
// two borders.
+1 -1
View File
@@ -1,6 +1,6 @@
# Roadmap: milestones and what's next
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush Line truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style libraryLine truncated
>
> Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865).
>
+2 -1
View File
@@ -1,6 +1,6 @@
# Parity with Adobe Illustrator
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and AssiLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; pLine truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -1078,6 +1078,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- In the Layers panel only the primary mouse button drags. A drag with the right or middle button on a row, a guide row, the selection square, the eye or lock column or a target circle moves, copies, hides, locks and transfers nothing and records no undo step, and a right-click still opens the row's menu (`panels::layers` test `only_the_primary_button_drags_rows_guides_art_columns_and_appearances`).
- Rows or the selection square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise; the cursor follows Alt pressed or released mid-drag. The copy cursor is the panels' add cursor (#8241): on Windows and X11, which have no system copy cursor winit can show, the white arrow with a plus. Over the trash and New Layer, which delete or duplicate with or without Alt, the hand stays, and guide rows keep their own cursor (#8217; `panels::layers` tests `alt_shows_the_copy_cursor_while_rows_are_dragged` and `drag_cursor_shows_a_copy_only_where_the_drop_copies`).
- An Alt-drag in the Layers panel copies rows above or below one of their own rows (`layer.move` with `copy` and that row as the target), and the bottom layer Alt-dragged into the empty space under the list is copied below itself. So the top layer dragged up, the bottom layer dragged down and a document's only layer are copied, as any other row is. A move onto its own place, and a copy inside itself, still change nothing (#8237; `panels::layers` tests `alt_dragging_the_top_layer_up_or_the_bottom_layer_down_copies_it` and `a_lone_layer_alt_dragged_up_or_down_is_copied`; engine test `a_copy_goes_above_or_below_a_row_it_copies`).
- A tool drag held within 24 points of an edge of the canvas scrolls the view away from that edge (#8551), faster nearer it (up to 900 points a second at the edge and no faster in a corner, a tenth of a second at most for a stalled frame), by whole device pixels with a remainder of its own, and keeps scrolling while the pointer stays still: zoomed in, a Selection tool move carries the art on past what showed, and a drawing tool's shape goes on growing. Only once the pointer has moved 3 points from the press on screen (a wheel scroll under a still press does not count), with the pointer over the canvas itself (past its edge, over a panel, the Selection tools hand the art to the panels instead, #2826); back away from the edge it stops. The zone and speeds are VectorCraft's own (`canvas::tests_edge_scroll` tests `a_move_held_near_the_right_edge_scrolls_the_view_and_carries_the_art`, `a_rectangle_drag_held_near_the_bottom_edge_keeps_growing`, `a_press_held_still_near_the_edge_does_not_scroll`, `a_hand_drag_held_near_the_edge_does_not_scroll_on`, `a_wheel_scroll_under_a_still_press_near_the_edge_does_not_start_edge_scrolling`, `edge_scroll_moves_the_content_away_from_the_edge_the_pointer_is_near` and `edge_scroll_pixels_keep_the_remainder_of_an_axis_that_does_not_scroll`).
- Rows dragged in the Layers panel and held within 28 points of the list's top or bottom edge scroll a long list that way, faster nearer the edge (60 points a second at the band's inner side, 340 at the edge, at every frame rate), and keep scrolling while the pointer stays still, so a row out of view can take the drop (a move, or a copy with Alt); the Libraries panel's list scrolls by the same rule. In a list view shorter than 56 points each band is half the view, so a pointer in the top half scrolls up, one in the bottom half scrolls down, and a pointer just outside the view does not scroll it toward the far edge. A pointer beside the list, a drag of the eye or lock column and a release stop the scrolling, and scrolling changes nothing in the document. The band and speeds are VectorCraft's own (`panels::layers` tests `rows_held_near_the_bottom_or_top_edge_scroll_the_list_to_a_row_out_of_view`, `a_held_row_scrolls_the_list_as_far_in_the_same_time_at_any_frame_rate` and `the_list_scrolls_only_for_rows_held_over_it`; `panels` test `drag_scrolling_in_a_short_list_goes_toward_the_nearer_edge`).
- The other panels' item drags start only with the primary mouse button too: swatches and color groups, brushes, symbols, graphic styles, library items and groups, character and paragraph styles, Appearance rows and its thumbnail, the Fill and Stroke squares, Recent Colors and the Gradient panel's thumbnail. A right or middle drag on one carries nothing, moves, copies, deletes and applies nothing and records no undo step; right-click menus and the Graphic Styles panel's held right-button preview stay as they were (`panels::swatches` test `only_a_primary_drag_moves_swatches_and_groups`, `panels::text_styles` test `only_a_primary_drag_carries_a_style_row`, `panels::tests_symbol_libraries` test `only_a_primary_drag_carries_a_library_symbol_out`, `panels::tests_effectedit` test `only_a_primary_drag_carries_the_thumbnail_or_a_row`).
- Panels undock (#495): a dock tab, a panel icon or a popped-out panel's title dragged out of the dock floats that panel (in an OS window of its own on the desktop, #4135), and the strip right of the dock's tabs floats the whole tabbed group. A floating group moves by its title bar, a tab dragged out of it floats on its own, and dropped on another group's title bar or tabs it stacks with that group; dropped on a dock group's tabs, which light up under the pointer, its panels join that group, and on the group's upper or lower half they make a new group above or below it (`window.panel.dock {anchor, zone}`); dropped on the icon column they become icons there, the tabbed group's panels too (`window.panel.dock {icon: true}`); dropped anywhere else on the dock, which lights up, they go back where they live (the tabbed group or the icon column), as its × and the panel menus' Float Panel / Dock Panel do (`window.panel.float`, `window.panel.dock`). The Tools panel floats by its title bar and docks again on the window's left edge. Floating groups stack into sets: dropped on the upper or lower half of another group (a line shows where), a group joins it right above or below it, and the set's groups stack top to bottom, each showing one panel, moving together by the top group's title bar, whose × docks them all; a group dragged by its tab strip leaves the set (`window.panel.float {below, above}`). A double-click on a tab collapses a floating group to its tabs (`collapsed`), and a dock group too, a group below it moving up into the room; a second double-click, or a click on another of its tabs, expands it (`window.panel.collapse`, kept with the preferences and in saved workspaces). Sets dropped on the left edge of the icon column or of another dock column dock as dock columns (a multi-column dock, `window.panel.dock {column}`), whose groups stack, tab and tear out as a floating set's do, and whose top strip floats the column again. Floating panels, their sets and the Tools panel's position are kept with the preferences and in user workspaces, and clamped into a smaller window. Not done: panels in separate OS windows, reordering tabs by dragging, collapsing a set or dock column to icons, dock columns right of the default dock, resizing floating panels and the groups of a set.
+2 -1
View File
@@ -1,6 +1,6 @@
# UI and interaction parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab cLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline dLine truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -355,6 +355,7 @@ tools, never checked side by side) isn't captured row by row.
|---|---|---|
| Space: Hand; Cmd+Space / Cmd+Alt+Space: zoom in/out; middle button pans | done | Space pressed after a tool takes a drag keeps the view still and shows that tool's cursor. Shape and anchor tools may use Space to move the geometry being drawn. Cmd+Space pressed mid-drag likewise keeps the active tool cursor. Space held before a press starts a view gesture, and its view cursor returns after release. `space_during_a_pencil_drag_keeps_the_pencil_cursor`, `cmd_space_mid_tool_drag_keeps_the_active_tool_cursor` |
| Document window scroll bars along the right and bottom edges (Normal and Full Screen Mode with Menu Bar; none in Full Screen and Presentation Mode): a thumb as long as the view against the art and the artboards; dragging it scrolls, a click on the track pages, the wheel over a bar scrolls along it; in a rotated view they follow the screen's axes | partial | #2322. The span is the art and the artboards with half a window around them, not Illustrator's 227 in canvas: VectorCraft has no bounded drawing area (#2284). A track click pages rather than jumping to the click; the page size and the rotated-view behaviour are our own choice (the public documentation gives neither) |
| A tool drag held near an edge of the canvas scrolls the view (#8551): zoomed in, a selection moved, a shape drawn or a marquee dragged towards the panels goes on past what shows | partial | Within 24 points of the canvas edge, once the pointer has moved 3 points from the press, the view scrolls away from that edge, faster nearer it (up to 900 points a second at the edge, and no faster in a corner, where it scrolls both ways), and keeps scrolling while the pointer stays still; the tool gets the pointer's new place in the document, so moved art stays under the pointer. Back away from the edge it stops. A click near the edge, the Hand, Zoom and Rotate View drags and Space panning do not scroll. The pointer past the canvas edge does not scroll: over a panel the Selection tools hand the art to the panels (#2826). The zone and speeds are VectorCraft's own (the public documentation gives none). Tests: `canvas::tests_edge_scroll` |
| Cmd/Ctrl: last-used selection tool; Cmd+Alt: Group Selection inside Direct Selection | done | Cmd+Alt lends Group Selection only while Direct Selection is active (Cmd borrow from the Pen keeps Direct Selection so Alt stays copy/subtract); Cmd alone lends Direct Selection the Selection tool: its bounding box shows while Cmd is held over objects selected whole and its handles scale and rotate them, and a Cmd drag moves the whole object while its direct-selected anchors stay selected (#3901; no box over a selection with anchors picked yet); engine pointer and canvas regressions |
| Eyedropper copies effective character dimensions between transformed text objects | done | Point/area and grouped text, highlighted ranges, reverse/remembered sampling, opt-outs and atomic invalid-transform rejection; `scaled_type_pick_*` (#6404) |
| Eyedropper styles highlighted characters only and preserves ranges across Type switches | done | Font/paint, Shift color-only, Unicode, Undo/Redo and stale-range regression tests; enabled non-neutral source or target object transparency is refused atomically; disable Transparency to sample supported attributes |