Page MenuHome

Add a margin to ui_draw_but_CURVEPROFILE, see T841183
ClosedPublic

Authored by Pi Lanningham (Quantumplation) on Jan 4 2021, 6:59 PM.

Details

Summary

When drawing a curve profile (ex: for a custom bevel profile), if there was a control point at extreme positions (the bottom corner, generally), extra triangles would be rendered, giving a misleading view of the curve.

This is because the extra points added to create a closed shape were exactly on the border of the view. This adds a small margin to those points, so we always render correctly.

Another solution suggested by Hans Goudey (HooglyBoogly) is to use a different algorithm to fill the points, such as scanfill, which is used by curve objects. This seemed simpler, and seems to work fairly robustly.

Diff Detail

Repository
rB Blender

Event Timeline

Pi Lanningham (Quantumplation) requested review of this revision.Jan 4 2021, 6:59 PM
Pi Lanningham (Quantumplation) created this revision.

This is my first contribution, so let me know if this is what you were thinking :)

For reference, here's what things look like with this change, compare to the screenshot in T84183:

This revision was not accepted when it landed; it landed in state Needs Review.Jan 4 2021, 10:13 PM
This revision was automatically updated to reflect the committed changes.

Thanks for the patch! I adjusted the comment, and added .0fto the floats you added, but other than that the patch was good to go already.

๐Ÿ‘ Thanks! I'll look for some other stuff to work on after work today. :)