diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-01-17 11:36:24 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2022-02-06 11:11:41 +0100 |
commit | 69ef42fedda05b2eca65883ebc8e2db4c5811001 (patch) | |
tree | d4a3d72ce4315cc404fda27be9490154eb2d42bb /svx | |
parent | 6ed0ffe9177ff6851e1b1e338dd92f81e7987f57 (diff) |
svx-lok: incomplete invalidation when resizing/deleting...
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>
(cherry picked from commit 242d2752aa6af2c52affc90e84b58c59c5fa779d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129440
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'svx')
-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 5facfc45d237..01be77135674 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -430,8 +430,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()) { OutputDevice& rWindow(GetPaintWindow().GetOutputDevice()); basegfx::B2DRange aDiscreteRange(rRange); @@ -444,10 +443,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()); @@ -455,7 +458,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 |