You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split SVG codec into DemaConsulting.CanvasNet.Svg package - #30
Splits the SVG codec out of the monolithic DemaConsulting.CanvasNet package
into its own DemaConsulting.CanvasNet.Svg NuGet package, as the first step
in a broader packaging strategy ahead of adding much larger format codecs
(PDF/PPTX/VSDX).
Changes
New project src/DemaConsulting.CanvasNet.Svg containing the SVG codec
(34 files, namespace DemaConsulting.CanvasNet.Svg), referencing core DemaConsulting.CanvasNet.
New test project test/DemaConsulting.CanvasNet.Svg.Tests with the moved
SVG unit/fixture tests plus the SVG integration tests relocated out of CanvasNetTests.cs.
New top-level Software System artifacts (canvas-net-svg) added under docs/reqstream, docs/design, docs/verification, and docs/sysml2,
per software-items.md (a new distributable package = a new top-level
Software System, not a nested unit). Old nested canvas-net/codecs/svg-codec.*
files removed; parent canvas-net docs updated with cross-references.
.reviewmark.yaml, CanvasNet.slnx, .github/workflows/build.yaml, README.md, requirements.yaml updated for the new package.
lint.ps1: removed an unsafe git stash-based dotnet format check
(added in 739b55d) that corrupts the working tree on bulk git mv
renames. Replaced with a simple non-mutating --verify-no-changes
dry-run, with a text-match fallback for the still-open, macOS-specific dotnet/sdk#41422 exit-code bug.
Extracts the SVG rasterization codec into its own NuGet package and
software system (CanvasNetSvg), separate from the core CanvasNet
package/system, per software-items.md. Moves source, tests, and
fixtures into new src/DemaConsulting.CanvasNet.Svg and
test/DemaConsulting.CanvasNet.Svg.Tests projects, renames the SVG
codec namespace to DemaConsulting.CanvasNet.Svg, and promotes SVG's
requirements/design/verification/SysML2 model to top-level
canvas-net-svg artifacts parallel to canvas-net.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the stash-push/format/diff/checkout/stash-pop dance (added in
739b55d to work around dotnet/sdk#41422) with a simple non-mutating
dry-run check. The stash-based approach snapshots the full worktree
but only reverts a pathspec-scoped subset, which corrupts the repo
when combined with bulk git-mv renames (as encountered while
splitting the SVG codec into its own package). dotnet/sdk#41422 is
confirmed still open and macOS-specific; its diagnostic text
("failed to verify formatting") is printed reliably regardless of
the exit-code bug, so checking exit code OR that text is a safe
fallback that never touches git state.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1. Remove cross-package InternalsVisibleTo from CanvasNet to
CanvasNet.Svg; SvgCodec.Markers.cs now computes the closing-edge
tangent directly via NormalizeOrNull instead of calling internal
PathCommand.LineTo.
2. Add canvas-net-svg.md and canvas-net-svg/svg-codec.md to
docs/design/definition.yaml's input-files.
3. Add docs/reqstream/canvas-net-svg/platform-requirements.yaml
(mirrors canvas-net/platform-requirements.yaml), wire it into
requirements.yaml and the CanvasNetSvg-Design review-set in
.reviewmark.yaml.
4. Add 16 new CanvasNetSvg_SystemIntegration_* system-level tests to
SvgSystemIntegrationTests.cs covering every top-level CanvasNetSvg
requirement that previously had only unit-test (SvgCodec_*)
evidence, and link them in docs/reqstream/canvas-net-svg.yaml.
5. Add canvas-net-svg.md and canvas-net-svg/svg-codec.md to
docs/verification/definition.yaml's input-files, and mention
CanvasNetSvg coverage in docs/verification/introduction.md's scope.
6. Rewrite the design doc's Risk Control Measures section to
separate tolerantly-skipped no-effect constructs from reference
cycles and resource-disproportionate constructs, both of which are
rejected via a thrown InvalidDataException.
7. Correct docs/sysml2/model/canvas-net-svg.sysml wording: CanvasNet
and CanvasNetSvg share a git repository but are separate NuGet
packages.
8. Reword the "no I/O" claim in docs/verification/canvas-net-svg.md
to distinguish no network/service I/O from supported local
file-path I/O via Load(string)/GetInfo(string), and add/rename
verification test-scenario descriptions to match the current
public test suite.
9. Rename the two CanvasNet_SystemIntegration_* tests in
SvgSystemIntegrationTests.cs to the CanvasNetSvg_ prefix, and
update every reqstream/verification cross-reference to the old
names.
Supersede the earlier option (a) fix (a private, SVG-package-local
tangent helper) with option (b): a deliberate, documented, tested
PUBLIC core API, since a future PDF/PPTX/VSDX codec package will
plausibly need the same path-segment-tangent computation for its own
marker/arrowhead-style rendering.
- Add PathCommand.ComputeTangents(start) (public instance method) to
DemaConsulting.CanvasNet, computing a command's outgoing/incoming
unit tangent directions for LineTo/QuadraticBezierTo/CubicBezierTo,
returning (null, null) for ArcTo/Close.
- Make PathCommand.LineTo(end) public (previously internal), so an
external consumer can synthesize a standalone line-segment command
(needed to represent an implicit closing edge, which is never
itself recorded as its own PathCommand).
- Update SvgCodec.Markers.cs to call command.ComputeTangents(current)
and PathCommand.LineTo(subpath.Start).ComputeTangents(...) instead
of its own private duplicate of this logic.
- Add PathCommandTests.cs (9 tests) to DemaConsulting.CanvasNet.Tests
covering LineTo and ComputeTangents for every PathCommandType.
- Add CanvasNet-Geometry-PathCommand-PublicLineToFactory and
CanvasNet-Geometry-PathCommand-ComputeTangents requirements to
docs/reqstream/canvas-net/geometry/path.yaml, and corresponding
design/verification coverage in
docs/design/canvas-net/geometry/path.md and
docs/verification/canvas-net/geometry/path.md.
- Add the new test file to the CanvasNet-Geometry-Path review-set in
.reviewmark.yaml.
The cross-package InternalsVisibleTo grant remains removed, as
before; SvgCodec.Markers.cs no longer needs it because it now calls
only PathCommand's public API.
The CI "Build Documents" job failed reqstream --enforce with 2
orphaned requirements: CanvasNet-Geometry-PathCommand-PublicLineToFactory
and CanvasNet-Geometry-PathCommand-ComputeTangents. These leaf
requirements were added to docs/reqstream/canvas-net/geometry/path.yaml
but never linked into the System -> Unit -> leaf decomposition chain
(reqstream requires exact-id children references at every tier, not
prefix matching).
Add both ids to the existing CanvasNet-Geometry-Path unit-level
requirement's children list in docs/reqstream/canvas-net/geometry.yaml,
and update its title/justification to describe the new public
LineTo/ComputeTangents surface. Also updates the corresponding
system-level CanvasNet-Lib-GeometryPath title/justification in
docs/reqstream/canvas-net.yaml for consistency (children unchanged,
since CanvasNet-Geometry-Path already covers the new leaves).
Verified locally: dotnet reqstream --enforce no longer reports any
orphaned requirements; build.ps1 and lint.ps1 both pass cleanly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- lint.ps1: fix macOS dotnet-format fallback regex to match the actual
MSBuild-style ': error <CODE>:' diagnostic text instead of a
nonexistent 'failed to verify formatting' phrase
- PathCommand.NormalizeOrNull: compute squared length in double
precision to avoid spurious float-squaring overflow for large-but-
finite vectors (~1.8e19+ magnitude), which previously caused valid
directions to be misreported as degenerate; add a covering unit test
- SvgSystemIntegrationTests: strengthen the SvgFilterRendering system
test to assert a halo pixel outside the source rect (matching the
unit-level assertion), proving the filter chain actually ran
- docs/reqstream/canvas-net-svg.yaml: reword the SvgFilterRendering
parent requirement to reflect the true split behavior - oversized
filter regions/blur radii are tolerated (skipped/clamped) while
excessive convolution-order/morphology-radius/turbulence-octave
parameters are rejected with InvalidDataException, matching the
FilterPrimitiveResourceSafety child requirement and its tests
- docs/reqstream/canvas-net-svg.yaml and
docs/reqstream/canvas-net-svg/svg-codec.yaml: replace out-of-scope
construct examples that contradicted this same file's own supported-
feature requirements (filters, masks, style, clipPath, pattern,
image) with the actual unsupported constructs per the design doc
(nested svg, SMIL animation elements, foreignObject)
- SvgSystemIntegrationTests.cs: fix a duplicated '///' XML-doc marker
embedded in a summary comment's text
- cspell: add SMIL to canvas-net-svg.yaml's ignore list
- docs/reqstream/canvas-net.yaml: CanvasNet-Lib-GeometryPath's title
promises the public PathCommand.LineTo factory and ComputeTangents
behavior, but its only linked system test never exercised either
API; add CanvasNet_SystemIntegration_LineToAndComputeTangents_
ReturnsNormalizedDirection to test/DemaConsulting.CanvasNet.Tests/
CanvasNetTests.cs exercising both through the public API, and link
it on the requirement alongside the existing test
…traction
NormalizeOrNull previously accepted a pre-subtracted Vector2, so the
point-to-point delta (e.g. EndPoint - start) still overflowed in float
for finite-but-extreme coordinates (near +/-float.MaxValue) before any
double-precision widening could help. NormalizeOrNull now accepts the
two endpoints directly and computes the delta in double, fixing
ComputeTangents for such inputs.
Also replaced exact-float-equality assertions in PathCommandTests with
a tolerance-based AssertDirectionApproximatelyEqual helper, since the
production code's double-widened computation and the tests' pure-float
Vector2.Normalize(...) reference values can legitimately differ by a
single ULP.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Model CanvasNetSvgSystem parts as dependencies, not owned children
docs/sysml2/model/canvas-net-svg.sysml:16
These ordinary part usages model four additional compositional children of CanvasNetSvgSystem, rather than dependencies on the sibling core system. That contradicts the system design's statement that SvgCodec is the system's single implemented unit and causes architecture queries/diagrams to present duplicated core subsystems as CanvasNetSvg constituents. Represent these as non-owning references/dependencies, or model a dependency on CanvasNetSystem itself.
… uses as dependencies
- NormalizeOrNull was comparing the double-precision squared length
against float.Epsilon, which rejected valid tiny-but-distinct
segments (e.g. length ~1e-30) even though the public contract
promises a unit tangent for every nonzero finite direction. Now
rejects only an exactly zero squared length.
- Added the two large-coordinate ComputeTangents tests to the
CanvasNet-Geometry-PathCommand-ComputeTangents verification scenario,
which previously omitted them despite listing them as evidence.
- Modeled CanvasNetSvgSystem's use of the core CanvasNet system's
Canvas/Geometry/Drawing/Fonts subsystems as non-owning dependency
relationships instead of ordinary part usages, since the latter
incorrectly modeled them as additional owned children of
CanvasNetSvgSystem (duplicating core subsystems in architecture
queries/diagrams) rather than as a dependency on the sibling system.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The exception contract omits the upper bound: Surface also throws ArgumentOutOfRangeException when either dimension exceeds Surface.MaxDimension (8192), not only when it is non-positive. Document the complete valid range so callers do not assume arbitrarily large positive raster sizes are accepted.
This issue also appears in the following locations of the same file:
line 68
line 143
Update caller description to include PathFiller and PathStroker
docs/design/canvas-net/geometry/path.md:179
This caller description is stale: the repository now has public Drawing.PathFiller and PathStroker APIs that consume Geometry.Path, so it is incorrect to say no rasterizer exists. Update the section to identify those in-repository callers while retaining the new external SVG marker caller.
- Documented Surface's full valid width/height range (non-positive AND
exceeding Surface.MaxDimension (8192) both throw
ArgumentOutOfRangeException) in canvas-net-svg.md's API description,
interface constraints table, and data-flow validation step.
- Updated the Geometry Path unit's caller description to name the
in-repository Drawing.PathFiller/PathStroker callers instead of
claiming no rasterizer exists, while retaining the external SVG
marker caller.
- Added the missing Codecs subsystem dependency to the
CanvasNetSvgSystem sysml2 model (SvgCodec.GetInfo returns the shared
Codecs.ImageInfo record struct).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The verification scenario omits PathCommand_ComputeTangents_LineToWithLargeFiniteCoordinates_ReturnsValidNormalizedDirection, although that test was added and is linked by the corresponding requirement. Add it so the verification design fully describes the new overflow-regression coverage.
Update constructor documentation for public LineTo
Making LineTo public leaves the private constructor's XML documentation at line 82 stating that only “internal factory methods” construct instances. Update that comment to say the struct's factory methods construct instances so the API documentation no longer contradicts this accessibility change.
…ethod comment
- Added the Codecs subsystem to introduction.md's three CanvasNetSvg
dependency mentions and to canvas-net.sysml's reverse-dependency
comment, matching the sysml2 model's usesCodecs dependency and
SvgCodec.GetInfo's actual use of Codecs.ImageInfo.
- Added the missing large-finite-coordinate LineTo test name to the
ComputeTangents verification scenario.
- Corrected PathCommand's private constructor doc comment, which still
said only "internal factory methods" construct instances even
though LineTo is now a public factory method.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
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.
Summary
Splits the SVG codec out of the monolithic
DemaConsulting.CanvasNetpackageinto its own
DemaConsulting.CanvasNet.SvgNuGet package, as the first stepin a broader packaging strategy ahead of adding much larger format codecs
(PDF/PPTX/VSDX).
Changes
src/DemaConsulting.CanvasNet.Svgcontaining the SVG codec(34 files, namespace
DemaConsulting.CanvasNet.Svg), referencing coreDemaConsulting.CanvasNet.test/DemaConsulting.CanvasNet.Svg.Testswith the movedSVG unit/fixture tests plus the SVG integration tests relocated out of
CanvasNetTests.cs.NamespaceDoc.csupdated.canvas-net-svg) added underdocs/reqstream,docs/design,docs/verification, anddocs/sysml2,per
software-items.md(a new distributable package = a new top-levelSoftware System, not a nested unit). Old nested
canvas-net/codecs/svg-codec.*files removed; parent
canvas-netdocs updated with cross-references..reviewmark.yaml,CanvasNet.slnx,.github/workflows/build.yaml,README.md,requirements.yamlupdated for the new package.lint.ps1: removed an unsafegit stash-baseddotnet formatcheck(added in 739b55d) that corrupts the working tree on bulk
git mvrenames. Replaced with a simple non-mutating
--verify-no-changesdry-run, with a text-match fallback for the still-open, macOS-specific
dotnet/sdk#41422exit-code bug.Validation
build.ps1: 0 warnings, 4926/4926 tests passing.lint.ps1: passes cleanly end-to-end (yamllint, cspell/markdownlint,reqstream, versionmark, reviewmark, sysml2tools, dotnet format).
dotnet packverified to produce correct nupkg/snupkg pairs with theexpected package dependency edge.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com