openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.98k stars 2.55k forks source link

about stroke align with ofSetLineWidth #8069

Open 2bbb opened 3 months ago

2bbb commented 3 months ago

This is just propose.

So great PR #8019 was merged.

It is awesome and too useful. and, I think if we can specify stroke align like inner / center / outer.

How do you think?

ofTheo commented 3 months ago

@2bbb - I think any stroke / line width tools would be absolutely welcome! If you wanted to PR - it would be a great addition.

cc @NickHardeman

NickHardeman commented 3 months ago

@2bbb could be similar to ofSetRectMode(ofRectMode mode); maybe something like ofSetStrokeAlign(OF_STROKE_ALIGN_CENTER); I think it would be tricky with non-closed lines, like sine waves, etc. to determine which side is inside or outside.

2bbb commented 3 months ago

@ofTheo

maybe I can't implement the feature... only my desire 😉

@NickHardeman

exactly. it will effect to only close paths.

someone please implement this?

GitBruno commented 2 months ago

@2bbb could be similar to ofSetRectMode(ofRectMode mode); maybe something like ofSetStrokeAlign(OF_STROKE_ALIGN_CENTER); I think it would be tricky with non-closed lines, like sine waves, etc. to determine which side is inside or outside.

Inside: 1px, Outside: Will look like double.