Files
Don Omondi 5b18da25a8 fix(format): remove what a native file has beyond the canvas (#3575)
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.
2026-10-29 11:07:40 +07:00

31 lines
830 B
Rust
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! 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;