Fix #32123: Blender crashes when zoomed in and rotating around 3d cursor

Fix deadlock in drawArc caused by precision error. Helper widget could
look wrong, that's because of not enough precision of floats used by
Blender.

This is known issue of Blender and wouldn't consider a bug.
This commit is contained in:
Sergey Sharybin 2012-07-26 09:29:37 +00:00
parent ab0fa803cd
commit 6b7d013d8d

@ -1331,10 +1331,11 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
{
float delta = (angle_end - angle_start) / segments;
float angle;
int a;
glBegin(GL_LINE_STRIP);
for (angle = angle_start; angle < angle_end; angle += delta) {
for (angle = angle_start, a = 0; a < segments; angle += delta, a++) {
glVertex2f(cosf(angle) * size, sinf(angle) * size);
}
glVertex2f(cosf(angle_end) * size, sinf(angle_end) * size);