Skip to content

Inconsistent behavior with polyStroke() #314

Description

@thykka

I noticed that polyStroke() has a quirk, where given 2 or 5 arguments, it draws unclosed polygons, i.e.:

polyStroke([
  // empty array as last point
  [0,0], [64, 0], [64, 64], []
], 5)

image

When given 3 arguments however, it doesn't draw anything. I'm guessing this behavior appears because this:

Math.min.apply(
  Math,
  [[0,0], [1,1], []].map(p => p[0])
)

...would return NaN

Since drawing unclosed polylines has plenty of use-cases, perhaps this behaviour should be parametrized, and unified across the different drawing implementations?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions