Skip to content

Conversation

@noahc3
Copy link
Owner

@noahc3 noahc3 commented Nov 19, 2025

This PR implements a recursive subdivision algorithm for Direct2D (d2d1.dll) which corrects the rendering of pen paths. Wine upstream does not support cubic beziers, only quadratic beziers. This algorithm subdivides cubic beziers into smaller segments which can be approximated using quadratic beziers.

The accuracy of the subdivison algorithm can be adjusted by changing various parameters, a middle-ground between accuracy and performance was chosen for now, leaning towards performance. There are no visual artifacts with the chosen values (as far as my own eye can see). In the future there will be some form of quality slider to allow the user to adjust this balance themselves. It would also be ideal to add an OpenCL implementation in the future for users who have it working.

In lieu of native code patching (planned for a future release), a binary copy of d2d1.dll will be included in the WineFix distribution archives to be placed next to Affinity.exe to be loaded through normal DLL shadowing.

Source code for the d2d1.dll has been isolated and new build scripts were created to build only d2d1.dll without needing the entire Wine source. This is under WineFix/lib/d2d1 and is the source code that will be used to build the copy of d2d1.dll which will be included in the release. The only relevant file that was changed to implement the subdivison algorithm is geometry.c, any other changes are only to support the new build scripts in the isolated environment.

Since this is a change in the Wine runner, I'll open PRs on ElementalWarrior Wine and GameDirection Wine forks to incorporate this higher up. I'll also consider upstreaming to wine-staging, but no promises.

Resolves #8


image image
Without APL / d2d1 patch With APL / d2d1 patch

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

🚀 Build Artifacts Ready

Commit: 9bc5cc1
Build Workflow: View Run

📦 Direct Downloads (via nightly.link):

@noahc3 noahc3 self-assigned this Nov 19, 2025
@noahc3 noahc3 added winefix wf-patch For bugs that we'd like to patch in WineFix labels Nov 19, 2025
@noahc3 noahc3 merged commit b42c2ca into main Nov 20, 2025
4 checks passed
@noahc3 noahc3 deleted the d2d1-pen-path-fix branch November 20, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wf-patch For bugs that we'd like to patch in WineFix winefix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WineFix Patch: Fix pen path preview line rendering

2 participants