Regression in rendering of flowChartPunchedTape custom shape

Regression from:
20f8006e21

It's not a good idea to create the arc first in small
resolution and scale it later, because the result won't
be smooth (e.g. in case of flowChartPunchedTape).

Both cloud and flowChartPunchedTape rendered well after
that change. It seems the problem in case of cloud
was with the arc tangent values which should be calculated
based on the ARCANGLETO's original values before scaling.

Change-Id: I0315afd0452108b6539b4b8ba271d1615810d985
This commit is contained in:
Zolnai Tamás
2014-12-28 12:53:02 +01:00
parent 9bfeeee0aa
commit 04fa50e398

View File

@@ -1790,6 +1790,9 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
OSL_TRACE("ARCANGLETO angles: %f, %f --> parameters: %f, %f", fStartAngle, fSwingAngle, fT, fTE );
fWR *= fXScale;
fHR *= fYScale;
Rectangle aRect ( Point ( aStartPoint.getX() - fWR*cos(fT) - fWR, aStartPoint.getY() - fHR*sin(fT) - fHR ),
Point ( aStartPoint.getX() - fWR*cos(fT) + fWR, aStartPoint.getY() - fHR*sin(fT) + fHR) );
@@ -1799,8 +1802,8 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom(),
aStartPoint.X(), aStartPoint.Y(), aEndPoint.X(), aEndPoint.Y(), bClockwise);
basegfx::B2DPolygon aArc = CreateArc( aRect, bClockwise ? aEndPoint : aStartPoint, bClockwise ? aStartPoint : aEndPoint, bClockwise, aStartPoint == aEndPoint && fSwingAngle > F_PI);
// Now that we have the arc, move it to aStartPointB2D and also scale it.
basegfx::B2DHomMatrix aMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(fXScale, fYScale, aStartPointB2D.getX(), aStartPointB2D.getY());
// Now that we have the arc, move it to aStartPointB2D.
basegfx::B2DHomMatrix aMatrix = basegfx::tools::createTranslateB2DHomMatrix(aStartPointB2D.getX(), aStartPointB2D.getY());
aArc.transform(aMatrix);
aNewB2DPolygon.append(aArc);
}