Skip to content

Sample BSpline2D.AddToGraphicsPath on 0..1 - #485

Merged
dsn27 merged 1 commit into
masterfrom
fix/bspline2d-graphicspath
Oct 17, 2026
Merged

dsn27 merged 1 commit into
masterfrom
fix/bspline2d-graphicspath

Conversation

@dsn27

@dsn27 dsn27 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Bug fix taken from the closed #465 (#412).

What

BSpline2D.AddToGraphicsPath passed knot parameters (startParam to endParam) to PointAt, which expects 0..1. As a result, a spline whose knots do not run from 0 to 1 was drawn through wrong points in GDI+ paths. That affects printing, PaintToGDI and CompoundShape.CreateGraphicsPath. The method now samples 0..1.

Splines with knots from 0 to 1 produce the same path as before.

Test

tests/BSpline2DGraphicsPathTests.cs builds a spline with knots 0..5 and checks two things: the path starts and ends at the spline's endpoints, and every path point lies on the curve.

The test needs GDI+, so it is guarded by #if WINDOWS and does not run in the Linux CI. The same test ran green in the Windows job of the integration branch (#467), as part of #465's GdiExtensionsTests. Here I could only check that it compiles for net8.0-windows.

CADability.Tests on Linux: 627 passed, 18 skipped, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5


Generated by Claude Code

AddToGraphicsPath passed knot parameters (startParam..endParam) to
PointAt, which expects 0..1. A spline whose knots do not run from 0 to 1
was therefore drawn through wrong points; splines with knots from 0 to 1
are unaffected.

Taken from the closed #465. The test needs GDI+ and only runs on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5
@dsn27
dsn27 merged commit 2a66a52 into master Oct 17, 2026
1 check passed
@dsn27
dsn27 deleted the fix/bspline2d-graphicspath branch October 17, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants