From fbcb4011c261449ea35416fdba121dc9ec2fc585 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 31 Jan 2014 13:14:21 +0100 Subject: use fmod and make code simpler Change-Id: I09cc4fa8288fafa78083da5bdfb8ddc6fc273da9 --- chart2/source/view/main/DummyXShape.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'chart2/source') diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 44da9175e5c7..d7dcf1dfb9a6 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -351,9 +351,8 @@ void DummyPieSegment2D::render() { DummyChart* pChart = getRootShape(); - while(mfUnitCircleWidthAngleDegree>360) - mfUnitCircleWidthAngleDegree -= 360.0; - while(mfUnitCircleWidthAngleDegree<0) + mfUnitCircleWidthAngleDegree = std::fmod(mfUnitCircleWidthAngleDegree, 360.0); + if(mfUnitCircleWidthAngleDegree) mfUnitCircleWidthAngleDegree += 360.0; pChart->m_GLRender.GeneratePieSegment2D(mfUnitCircleInnerRadius, mfUnitCircleOuterRadius, -- cgit