Fix the wrong path calculation of Arc with small angle
This commit is contained in:
@@ -283,7 +283,7 @@ public abstract class AbstractArc extends RectangularShape implements IArc
|
|||||||
k = -k;
|
k = -k;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
arcCount = (int)Math.rint(Math.abs(extent) / 90f);
|
arcCount = MathUtil.iceil(Math.abs(extent) / 90f);
|
||||||
step = Math.toRadians(extent / arcCount);
|
step = Math.toRadians(extent / arcCount);
|
||||||
k = 4f / 3f * (1f - Math.cos(step / 2f)) / Math.sin(step / 2f);
|
k = 4f / 3f * (1f - Math.cos(step / 2f)) / Math.sin(step / 2f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ public abstract class AbstractArc extends RectangularShape implements IArc
|
|||||||
k = -k;
|
k = -k;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
arcCount = (int)Math.rint(Math.abs(extent) / 90f);
|
arcCount = MathUtil.iceil(Math.abs(extent) / 90f);
|
||||||
step = FloatMath.toRadians(extent / arcCount);
|
step = FloatMath.toRadians(extent / arcCount);
|
||||||
k = 4f / 3f * (1f - FloatMath.cos(step / 2f)) / FloatMath.sin(step / 2f);
|
k = 4f / 3f * (1f - FloatMath.cos(step / 2f)) / FloatMath.sin(step / 2f);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user