From a33484276ed16af7599a59653677f21f051c97e8 Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Tue, 3 Mar 2020 18:12:36 +0100 Subject: tdf#131033 consider 20° tilt of 3D in 2D projection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error was, that the default 20° tilt of a newly created 3D scene was not applied to the rectangle for the 2D projection and therefore the projection was not high enough. The used method is the same as used when dragging a scene to tilt it. I don't know whether there exists a simpler way. Change-Id: Ic9745cc17ed520cd9e00b123e235fe0e93100073 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89901 Tested-by: Jenkins Reviewed-by: Regina Henschel --- svx/source/engine3d/view3d.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'svx') diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index c756c90439c8..77d94ab1c581 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -50,6 +50,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -969,23 +970,22 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1 MarkObj(pScene, pPV); // Rotate Rotation body around the axis of rotation - basegfx::B3DHomMatrix aRotate; - if(!bExtrude && fRot3D != 0.0) { + basegfx::B3DHomMatrix aRotate; aRotate.rotate(0.0, 0.0, fRot3D); + pScene->SetTransform(aRotate * pScene->GetTransform()); } // Set default rotation - aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0); - - if(!aRotate.isIdentity()) { + basegfx::B3DHomMatrix aRotate; + aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0); + // E3DModifySceneSnapRectUpdater updates the 2D representation of the scene. + // It prepares things in ctor and acts in dtor. + E3DModifySceneSnapRectUpdater aUpdater(pScene->getSdrObjectFromSdrObjList()); pScene->SetTransform(aRotate * pScene->GetTransform()); } - - // Invalid SnapRects of objects - pScene->SetSnapRect(aRect); } else { -- cgit