mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-20 07:30:48 +00:00
fa98718820
* Canvas and Decal: insert an SVG image, drawn into a PNG as it is placed canvas.insert and canvas.decal take an SVG file or SVG data as well as PNG and JPEG. resvg (MIT OR Apache-2.0, without text, system fonts or embedded raster images) draws it into a PNG whose longest side is the new resolution parameter (default 1024, at most 4096), and the design keeps that PNG. The Canvas and Decal file dialogs list SVG files. Part of #18405. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal: tie an image's corners to sketch points, so dimensions and constraints place and stretch it (#18405) A canvas saves an optional anchor: a sketch and the points at the image's bottom-left, bottom-right and (optional) top-left corners. With the top-left point the image stretches with the rectangle; without it the height follows the image's shape; an image without an anchor stays where it was placed. canvas.frame_sketch (Frame Sketch in the canvas's context menu) draws a construction rectangle exactly around the image in a new sketch on its plane and anchors the image to it. canvas.edit sets or clears the anchor; an anchored canvas refuses a new centre, width or angle, Calibrate and Straighten. The viewport draws an anchored image where its sketch puts it. Format change: crates/doc/src/format/pending/canvas-anchor.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal: an image placed in the sketch being edited follows a frame in that sketch (#18405) An image put on the plane of the sketch being edited gets a construction rectangle around it in that sketch, so the sketch's own constraints and dimensions place and size it. canvas.insert and canvas.decal take `frame`, canvas.frame_sketch draws into the open sketch, and the Sketch preference "Images placed in a sketch follow a frame in it" keeps the old free image. An anchored image in a component is placed by that component's occurrence, and Edit Canvas edits only its opacity and flip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal: format the sketch-frame code (cargo fmt) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas SVG images: the canvas schema test lists resolution canvas.insert and canvas.decal take resolution; the key list in schemas_and_the_key_check_agree did not have it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Sketch anchors: the canvas schema test lists frame, anchor and frame_sketch canvas.insert and canvas.decal take frame, canvas.edit takes anchor, and canvas.frame_sketch takes canvas and name; schemas_and_the_key_check_agree now checks all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas SVG images: find the root after any prolog, refuse SVGZ, read no referenced file CodeRabbit review: is_svg looked for <svg in the first 4 KiB only, so an SVG with a long comment or DOCTYPE was refused; it now skips the prolog and checks the root element's name. usvg inflates SVGZ without a bound, so a compressed SVG is refused. usvg's default resolver reads the file an <image> names, so a resolver that resolves no file or address is set; data: images still draw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Sketch anchors: CodeRabbit review fixes - Images placed in a sketch follow a frame only when the Sketch preference frame_images_in_sketch is on; it is off by default, so placing an image works as before. - frame: "auto" on canvas.insert and canvas.decal frames the image in the sketch being edited only when it lies on that sketch's plane, else places it free. The image tools send it, so a face that crosses the sketch plane no longer makes the placement fail, and the UI computes no plane geometry. - canvas.to_sketch traces an anchored image where its frame shows it. - The frame's corners, the on-plane check and the viewport's grid points come from kernel primitives (solidcore::math::picture_frame, lifted_quad, parallelogram_point; solidcore_ops::affine wrappers and apply_point), not SolidCraft code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas SVG images: name png and tiny-skia by version in the lock file after the main merge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas SVG images: bump resvg to 0.50, all features still off As asked in review: resvg 0.50 instead of 0.45, still without text, system fonts, raster images and (now a feature of its own) SVGZ. It shares tiny-skia 0.12, png 0.18, kurbo 0.13 and roxmltree 0.21 with the rest of the workspace, so the older copies 0.45 pulled in are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal: their frame mode moves from Preferences to the Sketch Palette Whether an image placed on the open sketch's plane follows a construction rectangle in it is a mode of the Canvas and Decal tools, so it now shows in the Sketch Palette's Feature Options while either tool runs, and no longer in Preferences > Sketch. The choice is kept for the next image; it stays off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * picture_frame: name the area test once and negate it once (clippy) nonminimal_bool and neg_cmp_op_on_partial_ord flagged the two negated comparisons; a NaN width, height or cross product still returns None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * solidcore-ops affine: apply_point through transform_points, a type for lifted_quad (clippy) ops may not call Transform::transform_point (docs/layers.md §4); the allowed transform_points maps the point with the same rounding. lifted_quad's return type gets a name for type_complexity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kernel-cases EXEMPT: canvas.frame_sketch, tested in sketch_canvas.rs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal: their frame mode shows with no sketch open too The Sketch Palette opened only while a sketch was edited, so starting Canvas or Decal with none open showed the frame mode nowhere. The panel now also opens while either tool runs, titled with the tool and holding the mode alone; with no sketch open the mode frames the placed image in a new sketch on its plane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas and Decal in a sketch: the Sketch panel opens and comes to the front Started while a sketch is edited, Canvas and Decal showed their frame mode only if the Sketch panel was already open and in front. The panel host now opens the panel, or focuses it when it is folded or behind another tab, once each time either tool starts in a sketch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Sketch Palette: the image frame mode shows whenever a sketch is open It showed only once Canvas or Decal was running, that is after the image file was picked, so it could not be found from the sketch. It is now one of the sketch's options, and in Feature Options while either tool runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Canvas card: "Follow a frame in the sketch" replaces the frame mode The owner asked for the frame option in the Canvas and Decal options rather than Preferences. It is now a checkbox on the image's own card, which opens when the image is placed: ticked, the image is tied to a construction rectangle in a sketch (Frame Sketch); unticked, it is free again. Images are placed free as before, so no default changes; the stored mode and its Sketch Palette rows are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Sketch panel: the image frame mode is back, beside the Canvas card's checkbox The Sketch panel on the right shows "Frame the image in the sketch" whenever a sketch is open (and in Feature Options while Canvas or Decal runs): a Canvas or Decal placed on the sketch's plane with it ticked is framed in that sketch. The Canvas card keeps "Follow a frame in the sketch" to frame or free one image afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Revert "Sketch panel: the image frame mode is back, beside the Canvas card's checkbox" This reverts commit66bbc779f1. * Reapply "Sketch panel: the image frame mode is back, beside the Canvas card's checkbox" This reverts commit96a63af5f7. * Frame an image inside an outline of the open sketch: it fills the outline An image placed with the frame option inside a closed outline of four lines in the sketch being edited (a rectangle drawn there, or a face's projected edges) was given a rectangle of its own at its placed size, twice the face in the report, so it lined up with nothing. Its corners are now tied to the outline's corners, so it fills the face or rectangle and follows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sketch_canvas: rustfmt layout for fill_outline's anchor and dist Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Improved gitignore * Sketch Palette: show the frame mode only while Canvas or Decal runs The extra "Frame the image in the sketch" row sat in the palette for every sketch tool, which changed the palette under the Dimension tool and broke dimension_create_ui_tests::invalid_zero_negative_failed_open_and_click_away_leave_no_dimension. It is the Canvas and Decal tools' mode, so it now shows only in their Feature Options; with any other tool the palette is as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Improved gitignore --------- Co-authored-by: Leonard Uścinowicz <leo.uscinowicz@tum.de> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Leonard Uscinowicz <ge78zic@mytum.de>
38 lines
562 B
Plaintext
38 lines
562 B
Plaintext
# IDE configuration
|
|
.idea/
|
|
.code/
|
|
.vscode/
|
|
|
|
# Python venv and cache
|
|
.venv/
|
|
venv/
|
|
__pycache__/
|
|
*.pyc
|
|
|
|
# AI Agents
|
|
.claude/worktrees/
|
|
.claude/settings.local.json
|
|
.claude/*.sh
|
|
|
|
# Compiled target
|
|
/target*/
|
|
/target-snapshot
|
|
/plan/
|
|
/dist/
|
|
|
|
# OS files
|
|
*~
|
|
.DS_Store
|
|
|
|
# Temporary files
|
|
*.swp
|
|
|
|
# cargo-mutants output (docs/mutation-testing.md)
|
|
mutants.out*/
|
|
|
|
# external corpus downloads (cargo xtask external-corpus, #1397): fetched at test time,
|
|
# hash-pinned in tests/external-corpus.toml; never commit case data
|
|
/corpus/
|
|
|
|
# Separately compiled original plugin example.
|