summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/drwlayer.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 000bbcc85a46..e55c3d5bdbeb 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -739,8 +739,12 @@ void ScDrawLayer::ResizeLastRectFromAnchor( SdrObject* pObj, ScDrawObjData& rDat
// 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));
}
}
}