diff options
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate_util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index 93695e0fbab..d0f0c3aacce 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -230,6 +230,10 @@ static void imm_draw_disk_partial( GPUPrimType prim_type, uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep) { + /* to avoid artifacts */ + const float max_angle = 3 * 360; + CLAMP(sweep, -max_angle, max_angle); + /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */ const float angle_start = -(DEG2RADF(start)) + (float)(M_PI / 2); const float angle_end = -(DEG2RADF(sweep) - angle_start); |