chart2/source/view/charttypes/PieChart.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 87facad88d565e8e9fe21d04897058cca0ea55cd Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri Jan 26 10:46:37 2024 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Fri Jan 26 19:58:20 2024 +0100 tdf#134121 pie chart2: fix missing leaderLines at top/bottom of 3D ovals Yeah, it took me a while to clue in that this is no longer a circle, so we can't apply circle logic to it any more. Change-Id: I00f8b95cc75311342b9abd8c522ed06ca343a566 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162630 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 68e65b15d949..b9dd0517cf1f 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -520,11 +520,14 @@ void PieChart::createTextLabelShape( else if (nY1 > aRect.getMaxY()) nY2 = aRect.getMaxY(); - sal_Int32 nSquaredDistanceFromOrigin + const sal_Int32 nLabelSquaredDistanceFromOrigin = (nX2 - aOrigin.X) * (nX2 - aOrigin.X) + (nY2 - aOrigin.Y) * (nY2 - aOrigin.Y); + // can't use fSquaredPieRadius for 3D charts, since no longer a true circle + const sal_Int32 nPieEdgeSquaredDistanceFromOrigin + = (nX1 - aOrigin.X) * (nX1 - aOrigin.X) + (nY1 - aOrigin.Y) * (nY1 - aOrigin.Y); // tdf#138018 Don't show leader line when custom positioned data label is inside pie chart - if (nSquaredDistanceFromOrigin > fSquaredPieRadius) + if (nLabelSquaredDistanceFromOrigin > nPieEdgeSquaredDistanceFromOrigin) { //when the line is very short compared to the page size don't create one ::basegfx::B2DVector aLength(nX1 - nX2, nY1 - nY2);