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

segment function doesn't return an array of group #177

Open
albizures opened this issue Apr 17, 2022 · 1 comment
Open

segment function doesn't return an array of group #177

albizures opened this issue Apr 17, 2022 · 1 comment
Labels

Comments

@albizures
Copy link
Contributor

albizures commented Apr 17, 2022

According to the docs segments returns an array of groups, but it doesn't:

const run = Pts.quickStart( "pt", "#003" ); 
run((time, ftime) => { 
  const rect = Rectangle.corners(Rectangle.fromCenter(space.center, 60, 60));
  rect
    .clone()
    .segments(2, 1, true)
    .map((side, index) => {
      side.scale(1.5); // here side is an array of Pt
      form.strokeOnly("#f00", 18).line(side);
    })
});
@williamngan
Copy link
Owner

Thank you @albizures -- this is a bug. Will fix it in the next patch.

As a quick fix for now, you can try Group.fromPtArray(side).scale(1.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants