mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 07:42:42 +00:00
Finding where the Rotate All, Space, Move All and Select/Move widgets go and testing whether the pointer is over one flattened the group's path two to three times per widget. Starting a Space, Move All or Select/Move drag flattened it five times, and one pointer move over the group could flatten it eleven times. Each lookup now flattens the path once and shares that measurement across the widgets: - vectorcraft-doc makes `Measured` public with `stop` and `stops`, and adds `attachable`, which returns the path with its measurement. - `Widgets::of` gives all four widgets for the canvas, `widget_at` gives the widget under the pointer, and `WidgetDrag::hit` gives the drag a press starts, each from one flattening. The Selection and Objects on Path tools and the canvas use them. - A Space, Move All or Select/Move drag keeps its measurement and measures again only when the group's path changes. Widget places, hits, cursors and drag results are unchanged. The new `spine-count` feature of vectorcraft-doc exposes the flattening counter to vectorcraft-tools' tests; it is enabled only as a dev-dependency and leaves Cargo.lock unchanged.
32 lines
890 B
TOML
32 lines
890 B
TOML
[package]
|
|
name = "vectorcraft-doc"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "VectorCraft document model: artboards, layers, objects, appearance (pure data + serde)"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
# `vectorcraft_doc::blend::spines_built` for other crates' tests (dev-dependencies only).
|
|
spine-count = []
|
|
|
|
[dependencies]
|
|
vectorcraft-geom = { workspace = true }
|
|
vectorcraft-color = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
image = { workspace = true }
|
|
tiff = { workspace = true }
|
|
# 1-bit TIFFs compressed with CCITT Group 3 (Compression 2 and 3).
|
|
hayro-ccitt = { workspace = true }
|
|
zune-jpeg = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
chrono = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
jpeg-encoder = { workspace = true }
|
|
proptest = { workspace = true }
|