diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-13 11:04:36 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-17 10:05:36 +0100 |
commit | 5316ef725e26133be42f044bdc2229a9071c7c13 (patch) | |
tree | ebf02f713ba1f9f827304039163caa6a19849507 | |
parent | RTL: lok: handle mirrored mouse coordinates (diff) | |
download | core-5316ef725e26133be42f044bdc2229a9071c7c13.tar.gz core-5316ef725e26133be42f044bdc2229a9071c7c13.zip |
RTL: lok: render tunneled dialogs mirrored
Change-Id: I14d33706eddb99167cf5537f6ece379124187bf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128371
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r-- | vcl/source/window/paint.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 425c6c19118c..ea11451d99b9 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1234,13 +1234,14 @@ void Window::PixelInvalidate(const tools::Rectangle* pRectangle) { // In case we are routing the window, notify the client std::vector<vcl::LOKPayloadItem> aPayload; + tools::Rectangle aRect(Point(0, 0), aSize); if (pRectangle) - aPayload.emplace_back("rectangle", pRectangle->toString()); - else - { - const tools::Rectangle aRect(Point(0, 0), aSize); - aPayload.emplace_back("rectangle", aRect.toString()); - } + aRect = *pRectangle; + + if (IsRTLEnabled() && GetOutDev() && !ImplIsAntiparallel()) + GetOutDev()->ReMirror(aRect); + + aPayload.emplace_back("rectangle", aRect.toString()); pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload); } @@ -1376,6 +1377,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP if (comphelper::LibreOfficeKit::isActive()) { VclPtrInstance<VirtualDevice> pDevice(*i_pTargetOutDev); + pDevice->EnableRTL(IsRTLEnabled()); Size aSize(GetOutputSizePixel()); pDevice->SetOutputSizePixel(aSize); @@ -1428,6 +1430,8 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP i_pTargetOutDev->DrawOutDev(i_rPos, aSize, Point(), pDevice->PixelToLogic(aSize), *pDevice); + bool bHasMirroredGraphics = pDevice->HasMirroredGraphics(); + // get rid of virtual device now so they don't pile up during recursive calls pDevice.disposeAndClear(); @@ -1437,6 +1441,9 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP if( pChild->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame && pChild->IsVisible() ) { tools::Long nDeltaX = pChild->mnOutOffX - mnOutOffX; + if( bHasMirroredGraphics ) + nDeltaX = mnOutWidth - nDeltaX - pChild->mnOutWidth; + tools::Long nDeltaY = pChild->mnOutOffY - mnOutOffY; Point aPos( i_rPos ); |