Skip to content

Fall back to finite-diff tangent when analytic derivative is zero#21561

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:narrow_feather_fix
Jul 17, 2026
Merged

Fall back to finite-diff tangent when analytic derivative is zero#21561
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:narrow_feather_fix

Conversation

@andriiryzhkov

@andriiryzhkov andriiryzhkov commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #21525 and #21557

Path masks with ctrl == corner at a segment endpoint (potrace routinely emits this) hit the exact-zero branch in _path_border_get_XY, which returned DT_INVALID_COORDINATE. Gap-fill then bailed on invalid input and the border polyline connected surviving points across huge distances - the chaotic wide crossing lines reported.

Fall back to a finite-difference sample of the curve for those cases. Non-degenerate paths hit the analytic branch as before, so existing masks and the integration tests are byte-identical.

Replaces the earlier attempt in be7259b (which switched to finite-diff unconditionally and shifted every path mask by a few pixels)

@andriiryzhkov andriiryzhkov added this to the 5.6.1 milestone Jul 17, 2026
@andriiryzhkov andriiryzhkov self-assigned this Jul 17, 2026
@andriiryzhkov andriiryzhkov added the bugfix pull request fixing a bug label Jul 17, 2026
@andriiryzhkov andriiryzhkov linked an issue Jul 17, 2026 that may be closed by this pull request
@andriiryzhkov

Copy link
Copy Markdown
Collaborator Author

For release notes:

In Bug Fixes:

  • Fix feather rendering on path masks whose control points coincide with their corners; previously produced wildly displaced border lines instead of a proper offset outline

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit
TurboGit merged commit 0eba994 into darktable-org:master Jul 17, 2026
5 checks passed
@andriiryzhkov
andriiryzhkov deleted the narrow_feather_fix branch July 17, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression due to be7259b546e75c0afabcca8f9186fba9156b89ce AI Masking makes one point with extremely large feathering

2 participants