diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-01-17 11:36:24 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2022-01-17 19:30:43 +0100 |
commit | 242d2752aa6af2c52affc90e84b58c59c5fa779d (patch) | |
tree | 87c5cc60ead463eccce5d8c07f3e76e774668f6c | |
parent | f31219cf3b1ad517b919db6cc6ac11163e85fe25 (diff) |
svx-lok: incomplete invalidation when resizing/deleting...cp-21.06.13-1
shapes in writer. The problematic commit is
5e37acbaaa0b0891829907331ecacd2d3b67526d
lokCalcRTL: shapes: do not send negative(X) invalidations
The above change forced the lok mode to use the second branch hence avoid the
view-transformation based invalidation. This patch restores the old
branching condition, but do the negation of invalidation rectangle in
case of lok-calc-rtl mode(IsNegativeX).
Change-Id: I679473f0610d2edabeb6071edbb32a63a436d053
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128491
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | svx/source/svdraw/sdrpagewindow.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 2a4b3b4d708b..2260cb178e43 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -428,8 +428,7 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...) void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) { - bool bLOKActive = comphelper::LibreOfficeKit::isActive(); - if (!bLOKActive && GetPageView().IsVisible() && GetPaintWindow().OutputToWindow()) + if (GetPageView().IsVisible() && GetPaintWindow().OutputToWindow()) { const SvtOptionsDrawinglayer aDrawinglayerOpt; OutputDevice& rWindow(GetPaintWindow().GetOutputDevice()); @@ -443,10 +442,14 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) aDiscreteRange.grow(1.0); } + // If the shapes use negative X coordinates, make them positive before sending + // the invalidation rectangle. + bool bNegativeX = mpImpl->mrPageView.GetView().IsNegativeX(); + const tools::Rectangle aVCLDiscreteRectangle( - static_cast<tools::Long>(floor(aDiscreteRange.getMinX())), + static_cast<tools::Long>(bNegativeX ? std::max(0.0, ceil(-aDiscreteRange.getMaxX())) : floor(aDiscreteRange.getMinX())), static_cast<tools::Long>(floor(aDiscreteRange.getMinY())), - static_cast<tools::Long>(ceil(aDiscreteRange.getMaxX())), + static_cast<tools::Long>(bNegativeX ? std::max(0.0, floor(-aDiscreteRange.getMinX())) : ceil(aDiscreteRange.getMaxX())), static_cast<tools::Long>(ceil(aDiscreteRange.getMaxY()))); const bool bWasMapModeEnabled(rWindow.IsMapModeEnabled()); @@ -454,7 +457,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) GetPageView().GetView().InvalidateOneWin(rWindow, aVCLDiscreteRectangle); rWindow.EnableMapMode(bWasMapModeEnabled); } - else if (bLOKActive) + else if (comphelper::LibreOfficeKit::isActive()) { // we don't really have to have a paint window with LOK; OTOH we know // that the drawinglayer units are 100ths of mm, so they are easy to |