diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2020-03-03 18:12:36 +0100 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2020-03-04 14:22:49 +0100 |
commit | a33484276ed16af7599a59653677f21f051c97e8 (patch) | |
tree | d2ccb2230de33eabee9a6b2bdbb1c4f5a99ceae0 /svx | |
parent | bd1ef206d37eee556f5b4a0b1437b5c1b2d1a037 (diff) |
tdf#131033 consider 20° tilt of 3D in 2D projection
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 <rb.henschel@t-online.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
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 <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> +#include <svx/e3dsceneupdater.hxx> 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 { |