-
Notifications
You must be signed in to change notification settings - Fork 71
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 ConcreteShape type #401
Conversation
src/concrete_shape.rs
Outdated
impl Shape for ConcreteShape { | ||
type PathElementsIter<'iter> = Box<dyn Iterator<Item = crate::PathEl> + 'iter>; | ||
|
||
fn path_elements(&self, tol: f64) -> Box<dyn Iterator<Item = crate::PathEl> + '_> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to look at https://github.com/linebender/xilem/pull/591/files#diff-d503d474ddd46b17b3dcb3674bf88c1654f893c21e81bbf2cf2098196b804e58R362
To avoid the boxed iterator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, this did seem more inefficient than I remembered.
I personally have no use for this code with the type modified this way since it is now a closed enum, rather than my original patch which was an open enum due to the generic parameter. This makes the type not useful for a library, when the library is intended to be used by a crate that implements the |
We'll see in practice whether people have use for it. I already know it's going to be useful in Masonry. |
There is nothing here trait wise which requires the implementation to be in kurbo itself. IMO without supporting downstream implementations of the |
I also don't really understand what problem in Why can't some experimentation happen with a version of this within |
Well we could always stick to the version introduced in linebender/xilem#591 |
I definitely feel that I would prefer downstream crates adopting ad-hoc solutions over That is to say, that this is working around an issue with the Thus my feeling is that this patch doesn't fix the problem, it only fixes the common occurrences of the problem. I would rather not see this included lightly based on it's convenience, Apologies if i'm being overly difficult in this regard... |
Overall, there's been little enough enthusiasm for this feature that I'd rather close the PR for now. |
Supersedes #331.
Based on @ratmice's code in that PR.