summaryrefslogtreecommitdiffstats
path: root/chart2/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-03 13:04:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-03 12:50:06 +0100
commit7e23fec4b72a3512b898a84dd07fb89f6a6af25a (patch)
tree8342fd6ee91c7b0001ccadf6402bd353e9c2489e /chart2/source
parentDrop the --with-macosx-sdk option (diff)
downloadcore-7e23fec4b72a3512b898a84dd07fb89f6a6af25a.tar.gz
core-7e23fec4b72a3512b898a84dd07fb89f6a6af25a.zip
Introduce 'scale' to Point/Size/Rectangle, to simplify anisotropic scaling
Change-Id: I12c25838e8eec8d05e43b593790847c626edde31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124638 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 7c114d5fff72..9f1ff9342c98 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -315,15 +315,11 @@ void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
if (!IsMapModeEnabled())
{
- aRectangle.SetLeft( o3tl::convert(aRectangle.Left(), scaleX.GetDenominator(), scaleX.GetNumerator()) );
- aRectangle.SetRight( o3tl::convert(aRectangle.Right(), scaleX.GetDenominator(), scaleX.GetNumerator()) );
- aRectangle.SetTop( o3tl::convert(aRectangle.Top(), scaleY.GetDenominator(), scaleY.GetNumerator()) );
- aRectangle.SetBottom( o3tl::convert(aRectangle.Bottom(), scaleY.GetDenominator(), scaleY.GetNumerator()) );
+ aRectangle = aRectangle.scale(scaleX.GetDenominator(), scaleX.GetNumerator(),
+ scaleY.GetDenominator(), scaleY.GetNumerator());
}
- Point aOffset = this->GetOffsetPixelFrom(*pEditWin);
- aOffset.setX( o3tl::convert(aOffset.X(), nXNum, nXDen) );
- aOffset.setY( o3tl::convert(aOffset.Y(), nYNum, nYDen) );
+ Point aOffset = this->GetOffsetPixelFrom(*pEditWin).scale(nXNum, nXDen, nYNum, nYDen);
aRectangle = tools::Rectangle(aRectangle.TopLeft() + aOffset, aRectangle.GetSize());
}