Repository navigation
Conversation
The blend and envelope commands read their on/off params with bool_or,
which falls back to a default for a value that is not true or false.
object.envelope.editContents {"editing": "false"} turned Edit Contents
on, and object.envelope.options {"antiAlias": "false"} left Anti-Alias
on. Each call reported success. Make and Blend Options ignored smooth
given as text, and Move Spine Point ignored independent. Reshape Spine
Segment ignored perpendicular, and Make with Warp, Reset with Warp and
Envelope Options ignored horizontal. Reset with Mesh ignored
maintainShape, and Envelope Options ignored distortAppearance,
distortLinearGradients and distortPatternFills. Each used its default
or the current value instead.
These commands now fail with "`<key>` must be true or false" for a
value that is not true, false or null, as the grid and overprint
commands do. They leave the document, its undo history and the options
new blends and envelopes start with as they were. Make and Blend
Options refuse such a smooth also beside steps or distance, and the
warp commands refuse such a horizontal also beside an orientation.
Envelope Options refuses it whether or not a warp envelope is selected.
A null is read as a key left out.
Docs: docs/mcp.md, docs/target-app-parity.md.
Contributor
4 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
On
main, the blend and envelope commands read their on/off params withbool_or, which falls back to a default or the current value for a value that is not true or false.object.envelope.editContents {"editing": "false"}turns Edit Contents on, andobject.envelope.options {"antiAlias": "false"}leaves Anti-Alias on. Each call reports success. The reference app's envelope page says "Select Maintain Envelope Shape to keep the warp shape intact" for Reset With Mesh, and "Deselecting Anti-Alias can decrease the time it takes to distort rasters" under Envelope options (Reshape using envelopes).object.blend.makeandobject.blend.options(smooth),object.blend.spine.moveAnchor(independent),object.blend.spine.reshapeSegment(perpendicular),object.envelope.makeWithWarp,resetWithWarpandoptions(horizontal),object.envelope.resetWithMesh(maintainShape),object.envelope.options(antiAlias,distortAppearance,distortLinearGradients,distortPatternFills) andobject.envelope.editContents(editing) fail with "<key>must be true or false" for a value that is not true, false or null, the message the grid and overprint commands give (crates/engine/src/cmd/create.rs:423,overprint.rs:124). The document, the undo history and the options new blends and envelopes start with stay as they were. A null is read as a key left out.smoothalso besidestepsordistance. The warp commands refuse such ahorizontalalso beside anorientation, and Envelope Options refuses it whether or not a warp envelope is selected.docs/mcp.mdlists the keys, anddocs/target-app-parity.mdhas one line for the change. The true-or-false message already has a row in every complete catalog. The change adds no new message text and no catalog rows.How it was tested
New tests in vectorcraft-engine, each failing on
main, where the first call succeeds:tests_live::blend_make_and_options_refuse_a_smooth_given_as_textgivessmoothas strings, a number or an array, alone and besidesteps; no blend is made, the selected blend and the options new blends start with keep their spacing, andsmooth: truestill sets Smooth Color.tests_blendspine::spine_edits_refuse_a_boolean_given_as_textgivesindependentandperpendicularas a string, a number or an array; the blend stays as it was, and a handle moved with a nullindependentleaves the point smooth.tests_live::envelope_make_and_reset_refuse_a_boolean_given_as_textgiveshorizontalas text or a number, also beside anorientation, to Make with Warp and Reset with Warp, andmaintainShapeto Reset with Mesh; no envelope is made and the warp envelope keeps its warp, andhorizontal: falseand a nullmaintainShapestill work.tests_live::envelope_options_refuse_a_boolean_given_as_textgives each Anti-Alias and Distort flag andhorizontalas text, a number or an array, with a warp envelope, a mesh envelope and nothing selected; none of them changes, andantiAlias: falsebeside a nulldistortAppearanceandhorizontalstill works.tests_live::envelope_edit_contents_refuses_editing_given_as_textgiveseditingas"true","false",1and an array; the envelope, the selection and the undo history stay as they were, and a nulleditingturns Edit Contents on.Targeted checks while building:
cargo clippy -p vectorcraft-engine --all-targets -- -D warnings;cargo test -p vectorcraft-engine --liband--test command_sweep;cargo fmt --all -- --check;cargo xtask brands,layersandassets.On Windows 11 (x86-64) with rustc 1.99.1, on top of
mainatbc1ae08:CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask cipasses its 10 steps: 8,575 tests passed, 0 failed, 13 ignored.git merge-treereports no conflicts withmainatbc1ae08. #3266 (crates/engine/src/cmd/live.rs,tests_blendspine.rs) and #2539 (live.rs) also change these files and merge with this branch there;cargo check -p vectorcraft-engine --testspasses on the branch merged with each.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit
Bug Fixes
nullvalues are treated like omitted options and use the applicable defaults.Documentation
nullhandling.