common: code refactoring.

return as soon as possible.

Change-Id: If48e13e8976bc1692dadd9054b484bf7cd811917
This commit is contained in:
Hermet Park 2020-08-03 20:06:02 +09:00
parent e98988da02
commit 7106272d97

View file

@ -152,13 +152,13 @@ Result Shape::appendCircle(float cx, float cy, float rx, float ry) noexcept
Result Shape::appendArc(float cx, float cy, float radius, float startAngle, float sweep, bool pie) noexcept
{
const float M_PI_HALF = M_PI / 2.0;
auto impl = pImpl.get();
const float M_PI_HALF = M_PI * 0.5f;
//just circle
if (sweep >= 360) return appendCircle(cx, cy, radius, radius);
auto impl = pImpl.get();
startAngle = (startAngle * M_PI) / 180;
sweep = sweep * M_PI / 180;