jingwood / jingwood/d2dlib

Open path

Open
#52 2 comments 0 reactions 0 assignees View on GitHub
bug todo
Dominant language
C#
Stars
261
Forks
48
PR merge metrics
No merged PRs in 30d

Description

The library is fantastic, thank you for that. I have a little problem with the ClosePath - I can't specify, whether the path should be opened or closed (as it is possible using D2D1_FIGURE_END in D2D). It's impossible to draw bezier cubic curves like this (the first point is always connected to end point).

Also there is a crash/hang, when I don't call ClosePath and I'm trying to draw geometry. E.g.:

```
var path = crc.GR.Device.CreatePathGeometry();
path.SetStartPoint(new D2DPoint(0, 0.5f));

D2DBezierSegment seg1 = new D2DBezierSegment()
{
point1 = new D2DPoint(0.25f, 0),
point2 = new D2DPoint(0.75f, 1),
point3 = new D2DPoint(1, 0.5f),
};
path.AddBeziers(new D2DBezierSegment[] { seg1 });
path.ClosePath(); //if I don't add this line, the application hangs

graphics.DrawPath(path, D2DColor.AliceBlue, 2 * pixelSize);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided C# example through SetStartPoint, AddBeziers, ClosePath, and DrawPath. Investigate how ClosePath controls whether a path is closed and what happens when it is omitted. Done means open bezier paths remain open when requested and drawing an unclosed path no longer hangs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.