Kaydet (Commit) da957eff authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Andras Timar

Put text label outside of the pie if..

performLabelBestFitInnerPlacement fails.

Change-Id: Ic84e8b42e02da2023b22a9406c44d462170c5305
Reviewed-on: https://gerrit.libreoffice.org/64015
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Bunth <btomi96@gmail.com>
(cherry picked from commit 3339c730)
Reviewed-on: https://gerrit.libreoffice.org/64032Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 57b3e242
...@@ -1575,7 +1575,18 @@ void PieChart::performLabelBestFit(ShapeParam& rShapeParam, PieLabelInfo const & ...@@ -1575,7 +1575,18 @@ void PieChart::performLabelBestFit(ShapeParam& rShapeParam, PieLabelInfo const &
if( !performLabelBestFitInnerPlacement(rShapeParam, rPieLabelInfo) ) if( !performLabelBestFitInnerPlacement(rShapeParam, rPieLabelInfo) )
{ {
// TODO // If it does not fit inside, let's put it outside
PolarLabelPositionHelper aPolarPosHelper(m_pPosHelper.get(),m_nDimension,m_xLogicTarget,m_pShapeFactory);
auto eAlignment = LABEL_ALIGN_CENTER;
awt::Point aScreenPosition2D(
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment, css::chart::DataLabelPlacement::OUTSIDE
, rShapeParam.mfUnitCircleStartAngleDegree, rShapeParam.mfUnitCircleWidthAngleDegree
, rShapeParam.mfUnitCircleInnerRadius, rShapeParam.mfUnitCircleOuterRadius, rShapeParam.mfLogicZ+0.5, 0 ));
basegfx::B2IVector aTranslationVector = rPieLabelInfo.aFirstPosition - rPieLabelInfo.aOrigin;
aTranslationVector.setLength(150);
aScreenPosition2D.X += aTranslationVector.getX();
aScreenPosition2D.Y += aTranslationVector.getY();
rPieLabelInfo.xLabelGroupShape->setPosition(aScreenPosition2D);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment