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

Feature request: Enable lineJoin property when drawing Graphics primitives #1637

Closed
BossLevel opened this issue Apr 7, 2015 · 8 comments
Closed
Labels
📢 Accepting PRs Would welcome a PR from the community. 🙏 Feature Request Community request for new features, APIs, packages. 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests.

Comments

@BossLevel
Copy link

Hi guys - I'm drawing a load of lines and I'd really like them to have a lineJoin of "miter" rather than the sharp edges that currently exist. I'm happy to just draw them to a canvas context as I'm only caching the resulting image as a bitmap anyway (so limited performance concerns) and I've seen that you already have this available when working with text so was hoping it would be a quick fix ;-)

Any more info that you need, please just ask :)

N

@englercj englercj added 🙏 Feature Request Community request for new features, APIs, packages. Graphics labels Apr 7, 2015
@mattdesl
Copy link
Contributor

Thick lines can be tricky in WebGL. Things like triangle orientation, sharp miters, anti-aliasing, end caps, etc all tend to complicate the code. Eventually it would be cool if there was some shared modules in this space so that ThreeJS/stackgl/etc could take advantage.

If you want an easy approach that is pure WebGL (i.e. no 2D canvas), you can use the polyline-normals module. Given a set of 2D points, it will give you the normals and miter lengths for those points. From this you could create your own polygon with PIXI.Graphics.

Some references in case anybody wants to tackle this:
http://mattdesl.svbtle.com/drawing-lines-is-hard
stackgl/contributing#25

@BossLevel
Copy link
Author

Thanks for the comments and links :) Unfortunately a WebGL only approach isn't an option and TBH would be OTT for my case - I'd actually far rather just render to canvas and then modularise the PIXI cacheAsBitmap code to work (I'm using PIXI to avoid dealing with WebGL ;-) !) just for my use case.

Nice blog BTW but I don't agree with your comments about semi-colons ;-)

@englercj englercj modified the milestone: v3.x Apr 23, 2015
@gagan-bansal
Copy link

+1

@englercj englercj added Version: v5.x 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. 📢 Accepting PRs Would welcome a PR from the community. labels Sep 27, 2016
@Friksel
Copy link

Friksel commented May 4, 2018

+1
Very much appreciated if this will be in the lib. I'm drawing a lot of lines and curves on a project rightnow with PIXI and they don't look nice with sharp edges. Nice to see it's got the v5 tag! Looking forward to this.

@BossLevel
Copy link
Author

TBF, it's had a v3, v4 and a v5 tag ;-) (that's honestly not a criticism guys, I'm just messing with you :) !)

@JetLua
Copy link
Contributor

JetLua commented Jul 7, 2018

wait

@stale
Copy link

stale bot commented Feb 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Feb 24, 2019
@badbod99
Copy link

Should not be stale/closed, referenced in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📢 Accepting PRs Would welcome a PR from the community. 🙏 Feature Request Community request for new features, APIs, packages. 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests.
Projects
None yet
Development

No branches or pull requests

8 participants