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

[geom] withAttribs(path, {}) closes the path #431

Closed
cdaein opened this issue Dec 1, 2023 · 3 comments
Closed

[geom] withAttribs(path, {}) closes the path #431

cdaein opened this issue Dec 1, 2023 · 3 comments

Comments

@cdaein
Copy link

cdaein commented Dec 1, 2023

I've noticed that when a path is passed to withAttribs(), it closes the path.
I was hoping to keep my path open as it was - wondering if there's a reason to close it by default.

from the source:

withAttribs(attribs: Attribs): Path {

an example code:

  const c1 = cubic([100, 100], [300, 100], [400, 100], [400, 400]);
  const c2 = cubic([400, 400], [400, 600], [500, 600], [700, 700]);
  const path = pathFromCubics([c1, c2], { stroke: `red` });
  console.log(path); // closed:false
  console.log(withAttribs(path, {})); // closed:true

  draw(
    ctx,
    group({ __background: `black` }, [path, withAttribs(path, { alpha: 0.5 })]),
  );
@postspectacular
Copy link
Member

Hi @cdaein - thanks for spotting this, I've just updated the impl and will push a new release asap! 👍

@postspectacular
Copy link
Member

Sorry, forgot to reply here that I've released an update a few days ago.... hope you've noticed by now! :)

@cdaein
Copy link
Author

cdaein commented Dec 6, 2023

thank you for the update!

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

No branches or pull requests

2 participants