Skip to content

Fix wrapping arithmetic in min_dist_param by limiting Bezier degree#542

Merged
tomcur merged 1 commit intolinebender:mainfrom
tomcur:push-xlrltmprkork
Jan 22, 2026
Merged

Fix wrapping arithmetic in min_dist_param by limiting Bezier degree#542
tomcur merged 1 commit intolinebender:mainfrom
tomcur:push-xlrltmprkork

Conversation

@tomcur
Copy link
Member

@tomcur tomcur commented Jan 16, 2026

In preparation for enabling the clippy::cast_possible_wrap lint.

Currently the higest degree we use this function with are cubics, i.e. degree 3. By limiting the function for Beziers up to degree 255 we can easily prevent wrapping.

This is somewhat theoretical, as the function is not tested at those degrees anyway (which I've left as comment on the function).

In preparation for enabling the `clippy::cast_possible_wrap` lint.

Currently the higest degree we use this function with are cubics, i.e.
degree 3. By limiting the function for Beziers up to degree 255 we can
easily prevent wrapping.

This is somewhat theoretical, as the function is not tested at those
degrees anyway (which I've left as comment on the function).
@tomcur tomcur force-pushed the push-xlrltmprkork branch from 5d972bb to 57788f8 Compare January 16, 2026 20:06
@tomcur tomcur added this pull request to the merge queue Jan 22, 2026
Merged via the queue into linebender:main with commit 9ab9ef7 Jan 22, 2026
15 checks passed
@tomcur tomcur deleted the push-xlrltmprkork branch January 22, 2026 09:23
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