summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2001-02-02 11:23:52 +0000
committerArmin Weiss <aw@openoffice.org>2001-02-02 11:23:52 +0000
commit17a2434f4e680c047453acb7fd8d9a3bfd0cc54e (patch)
treed5aa1a30e7864543b92c3f65a2ebb5d1cfc2488e
parentb5c372a38185a4f709a8951549fb4dd4894e2299 (diff)
#83387#, #83391# Setting Camera related items leaded to SetCamera() which
in turn was setting these items at the scene thus loosing the changes of two of that items. Changed to take all changes into account at once.
-rw-r--r--svx/source/engine3d/scene3d.cxx49
1 files changed, 31 insertions, 18 deletions
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index bb62d10b99ab..8f87553a982d 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scene3d.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: aw $ $Date: 2001-01-26 14:01:08 $
+ * last change: $Author: aw $ $Date: 2001-02-02 12:23:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1566,30 +1566,43 @@ void E3dScene::PostItemChange(const sal_uInt16 nWhich)
switch(nWhich)
{
case SDRATTR_3DSCENE_PERSPECTIVE :
- {
- Camera3D aSceneCam(GetCamera());
- aSceneCam.SetProjection(GetPerspective());
- SetCamera( aSceneCam );
- break;
- }
case SDRATTR_3DSCENE_DISTANCE :
+ case SDRATTR_3DSCENE_FOCAL_LENGTH :
{
+ // #83387#, #83391#
+ // one common function for the camera attributes
+ // since SetCamera() sets all three back to the ItemSet
Camera3D aSceneCam(GetCamera());
+ BOOL bChange(FALSE);
+
+ // for SDRATTR_3DSCENE_PERSPECTIVE:
+ if(aSceneCam.GetProjection() != GetPerspective())
+ {
+ aSceneCam.SetProjection(GetPerspective());
+ bChange = TRUE;
+ }
+
+ // for SDRATTR_3DSCENE_DISTANCE:
Vector3D aActualPosition = aSceneCam.GetPosition();
double fNew = GetDistance();
- if(fabs(fNew - aActualPosition.Z()) > 1.0)
+ if(fNew != aActualPosition.Z())
{
aSceneCam.SetPosition( Vector3D( aActualPosition.X(), aActualPosition.Y(), fNew) );
- SetCamera( aSceneCam );
+ bChange = TRUE;
}
- break;
- }
- case SDRATTR_3DSCENE_FOCAL_LENGTH :
- {
- Camera3D aSceneCam(GetCamera());
- double fNew = GetFocalLength() / 100.0;
- aSceneCam.SetFocalLength(fNew);
- SetCamera( aSceneCam );
+
+ // for SDRATTR_3DSCENE_FOCAL_LENGTH:
+ fNew = GetFocalLength() / 100.0;
+ if(aSceneCam.GetFocalLength() != fNew)
+ {
+ aSceneCam.SetFocalLength(fNew);
+ bChange = TRUE;
+ }
+
+ // for all
+ if(bChange)
+ SetCamera(aSceneCam);
+
break;
}
case SDRATTR_3DSCENE_TWO_SIDED_LIGHTING :