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

Add Shape trait #5

Merged
merged 6 commits into from Jan 5, 2019

Conversation

Projects
None yet
1 participant
@raphlinus
Copy link
Contributor

raphlinus commented Jan 3, 2019

We want to use Shape as the main interface for filling and clipping
closed paths. One central idea of this trait is that special cases
(rect, circle) can be preserved, and a consumer can access those or
just get a path iterator, at its choosing.

Also some iterator stuff to make use more ergonomic.

raphlinus added some commits Jan 2, 2019

Add IntoIterator to BezPath
We plan to use `IntoIterator<PathEl>` as the main interface for paths,
so provide ergonomic access to it.
Add Shape trait
We want to use Shape as the main interface for filling and clipping
closed paths. One central idea of this trait is that special cases
(rect, circle) can be preserved, and a consumer can access those or
just get a path iterator, at its choosing.
Add bounding boxes
Compute bounding boxes for shapes.
Tweaks to Shape trait
I'm still thinking through ways to get around the lack of GAT in the
path iterator.
Fine-tuning Shape trait
Quite a number of issues with Shape addressed here:

* It's suitable for both open and closed paths.

* Add Shape for Line impl, `as_line` method in Shape, as this is
  an important case now that Shape can be open.

* The union logic of Rect didn't include the perimeter, so was not
  ideal for bounding box calculations (a major use case).

Also bumps version to 0.1.2 in preparation for release.
Fix BezPath bounding box logic
Now that Rect can't be completely empty, we need to make sure we start
with the first segment's bounding box, not the default Rect.

@raphlinus raphlinus merged commit 45357aa into master Jan 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment