diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-03 13:04:24 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-03 12:50:06 +0100 |
commit | 7e23fec4b72a3512b898a84dd07fb89f6a6af25a (patch) | |
tree | 8342fd6ee91c7b0001ccadf6402bd353e9c2489e /sfx2/source | |
parent | 9c6aa26092c509ec11be686451c77033e3474b33 (diff) |
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 'sfx2/source')
-rw-r--r-- | sfx2/source/view/lokcharthelper.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx index 7220621a566c..1016f90135c1 100644 --- a/sfx2/source/view/lokcharthelper.cxx +++ b/sfx2/source/view/lokcharthelper.cxx @@ -141,12 +141,8 @@ tools::Rectangle LokChartHelper::GetChartBoundingBox() const auto nYNum = p.first * scaleY.GetDenominator(); const auto nYDen = p.second * scaleY.GetNumerator(); - Point aOffset = pWindow->GetOffsetPixelFrom(*pRootWin); - aOffset.setX( o3tl::convert(aOffset.X(), nXNum, nXDen) ); - aOffset.setY( o3tl::convert(aOffset.Y(), nYNum, nYDen) ); - Size aSize = pWindow->GetSizePixel(); - aSize.setWidth( o3tl::convert(aSize.Width(), nXNum, nXDen) ); - aSize.setHeight( o3tl::convert(aSize.Height(), nYNum, nYDen) ); + Point aOffset = pWindow->GetOffsetPixelFrom(*pRootWin).scale(nXNum, nXDen, nYNum, nYDen); + Size aSize = pWindow->GetSizePixel().scale(nXNum, nXDen, nYNum, nYDen); aBBox = tools::Rectangle(aOffset, aSize); } } |