mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 20:27:05 -06:00
Edits refuse to leave anything beyond MAX_COORD (doc_sane checks the artboards, the guides, the ruler origin and the objects an edit touches), but the native loader didn't check them. A file with one object, artboard, guide or ruler origin out there opened without a warning, and then every move failed with "result would exceed the canvas", in-range objects included; saving kept it that way. Document::drop_beyond_canvas removes objects whose geometric bounds aren't finite or reach past MAX_COORD (a layer or non-clipping group keeps its children within it), artboards with their artboard guides, and guides out there, and puts the ruler origin back at the origin. load_file runs it after the depth limit and reports what it did with the other load notes; a file whose artboards all lie beyond the canvas is refused.
31 lines
830 B
Rust
31 lines
830 B
Rust
//! Integration tests: one test binary for the crate, one module per area.
|
||
// Unwrapping and panicking on failure is fine here, unlike in shipped code (AGENTS.md › Robustness).
|
||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||
|
||
#[path = "../support/affinity_docs.rs"]
|
||
mod affinity_docs;
|
||
#[path = "../../../affinity/tests/support/text_fixture.rs"]
|
||
mod text_fixture;
|
||
|
||
mod affinity_features;
|
||
mod affinity_local;
|
||
mod artboard_click;
|
||
mod beyond_canvas;
|
||
mod clear_commands;
|
||
mod compound_attributes;
|
||
mod dimensions;
|
||
mod eyedropper_sources;
|
||
mod find_replace_paras;
|
||
mod inline_text;
|
||
mod known_bugs;
|
||
mod lossy_overwrite;
|
||
mod model_based;
|
||
mod param_keys;
|
||
mod pen_click_after_smooth;
|
||
mod pen_endpoint_picking;
|
||
mod ruler_origin;
|
||
mod selection_commands;
|
||
mod stroke_visibility;
|
||
mod text_stroke_scale;
|
||
mod three_d_light_color;
|