Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows PathWalker to be used without creating a vtable #101

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

ginnyTheCat
Copy link
Collaborator

This removes the creation of a vtable optional for PathWalker by making the Path::walk method generic over PathWalker. As PathWalker is implemented for all &mut PathWalker passing &mut PathWalker or &mut dyn PathWalker to the walk method is still possible.

It also adds the optional curve_to_y and rect methods to the trait that default to calling the methods that mupdf would call as well if the function pointers in the fz_path_walker struct were None. This can sadly not be done for curve_to_v and quad_to as both of them require knowledge of the start position to call the default, which is not available to as as the trait.

This also changes the parameter type of the Path::rect function from i32 to f32 as this is what the C API seems to pass to us.

@messense messense merged commit 21266e2 into messense:main Feb 5, 2025
7 of 11 checks passed
@ginnyTheCat ginnyTheCat deleted the no-dyn-path-walker branch February 5, 2025 16:01
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