diff options
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 3a765e8965bd..e694fed7c25a 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -729,8 +729,12 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& // Reduce offset also when shrinking if (!bIsGrowingLarger) { - aRect.setX(rtl::math::round(static_cast<double>(aRect.getX()) * fWidthFactor)); - aRect.setY(rtl::math::round(static_cast<double>(aRect.getY()) * fHeightFactor)); + Point aAvailableSpaceInCell = Point(aRect.getX() - aLastCellRect.TopLeft().X(), + aRect.getY() - aLastCellRect.TopLeft().Y()); + aRect.setX(rtl::math::round(static_cast<double>(aRect.getX()) + + aAvailableSpaceInCell.X() * fWidthFactor)); + aRect.setY(rtl::math::round(static_cast<double>(aRect.getY()) + + aAvailableSpaceInCell.Y() * fHeightFactor)); } } } |