From 59edd056643125978483e7292bfb4b7be707cf3d Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Tue, 21 Jan 2020 13:16:09 +0100 Subject: tdf#126459: Consider translated origin of the view also on resize use-case is the presenter console on 2nd screen, media shape must be placed relative to the window w/ slide preview, not relative to the main window Change-Id: I120f86e399563d2aafc31d88d0a7f9d357f4840c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87135 Tested-by: Jenkins Reviewed-by: Katarina Behrens (cherry picked from commit d4561921dde7d350b3b4d5f793871bea8ba4546d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87258 Reviewed-by: Adolfo Jayme Barrientos --- slideshow/source/engine/shapes/viewmediashape.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 057b508437ae..c17b550372b1 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -244,8 +244,13 @@ namespace slideshow if( rRangePix.isEmpty() ) return true; - const Point aPosPixel( rRangePix.getMinX() + maWindowOffset.X, - rRangePix.getMinY() + maWindowOffset.Y ); + awt::Rectangle aCanvasArea; + UnoViewSharedPtr xUnoView(std::dynamic_pointer_cast(mpViewLayer)); + if (xUnoView) + aCanvasArea = xUnoView->getUnoView()->getCanvasArea(); + + const Point aPosPixel( rRangePix.getMinX() + maWindowOffset.X + aCanvasArea.X, + rRangePix.getMinY() + maWindowOffset.Y + aCanvasArea.Y ); const Size aSizePixel( rRangePix.getMaxX() - rRangePix.getMinX(), rRangePix.getMaxY() - rRangePix.getMinY() ); -- cgit v1.2.3