Author: alg
Date: Mon Sep 9 12:23:48 2013
New Revision: 1521070
URL: http://svn.apache.org/r1521070
Log:
i122777 Corrected texture mapping for 3D CustomShapes
Modified:
openoffice/trunk/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
Modified:
openoffice/trunk/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/customshapes/EnhancedCustomShape3d.cxx?rev=1521070&r1=1521069&r2=1521070&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
(original)
+++ openoffice/trunk/main/svx/source/customshapes/EnhancedCustomShape3d.cxx Mon
Sep 9 12:23:48 2013
@@ -385,7 +385,11 @@ SdrObject* EnhancedCustomShape3d::Create
// #116336#
// If shapes are mirrored once (mirroring two times
correct geometry again)
// double-sided at the object and two-sided-lighting at
the scene need to be set.
- if((bIsMirroredX && !bIsMirroredY) || (!bIsMirroredX &&
bIsMirroredY))
+ //
+ // #122777# Also use double sided for two fill styles since there
several 3d objects get
+ // created with a depth of 0; one of them is the backside which
needs double-sided to
+ // get visible
+ if(bUseTwoFillStyles || (bIsMirroredX && !bIsMirroredY)
|| (!bIsMirroredX && bIsMirroredY))
{
aSet.Put( Svx3DDoubleSidedItem( sal_True ) );
pScene->GetProperties().SetObjectItem(
Svx3DTwoSidedLightingItem( sal_True ) );
@@ -504,7 +508,9 @@ SdrObject* EnhancedCustomShape3d::Create
const Rectangle
aBoundRect(basegfx::fround(aTempRange.getMinX()),
basegfx::fround(aTempRange.getMinY()), basegfx::fround(aTempRange.getMaxX()),
basegfx::fround(aTempRange.getMaxY()));
aBoundRect2d.Union( aBoundRect );
- E3dCompoundObject* p3DObj = new E3dExtrudeObj(
a3DDefaultAttr, aPolyPoly, bUseTwoFillStyles ? 10 : fDepth );
+ // #122777# depth 0 is okay for planes when using double-sided
+ E3dCompoundObject* p3DObj = new E3dExtrudeObj(
a3DDefaultAttr, aPolyPoly, bUseTwoFillStyles ? 0 : fDepth );
+
p3DObj->NbcSetLayer( pShape2d->GetLayer() );
p3DObj->SetMergedItemSet( aLocalSet );
if ( bIsPlaceholderObject )
@@ -517,16 +523,21 @@ SdrObject* EnhancedCustomShape3d::Create
{
const XFillBitmapItem& rBmpItm
= (XFillBitmapItem&)p3DObj->GetMergedItem(XATTR_FILLBITMAP);
aFillBmp =
rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
- Size aLogicalSize =
aFillBmp.GetPrefSize();
- if ( aFillBmp.GetPrefMapMode()
== MAP_PIXEL )
- aLogicalSize =
Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM );
- else
- aLogicalSize =
OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(),
MAP_100TH_MM );
- aLogicalSize.Width() *= 5;
;// :-( nice scaling,
look at engine3d/obj3d.cxx
- aLogicalSize.Height() *= 5;
- aFillBmp.SetPrefSize(
aLogicalSize );
- aFillBmp.SetPrefMapMode(
MAP_100TH_MM );
-
p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
+
+ // #122777# old adaption of FillStyle bitmap size to
5-times the original size; this is not needed
+ // anymore and was used in old times to male the fill
look better when converting to 3D. Removed
+ // from regular 3D objects for some time, also needs
to be removed from CustomShapes
+ //
+ //Size aLogicalSize =
aFillBmp.GetPrefSize();
+ //if (
aFillBmp.GetPrefMapMode() == MAP_PIXEL )
+ // aLogicalSize =
Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM );
+ //else
+ // aLogicalSize =
OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(),
MAP_100TH_MM );
+ //aLogicalSize.Width() *= 5;
;// :-( nice scaling,
look at engine3d/obj3d.cxx
+ //aLogicalSize.Height() *= 5;
+ //aFillBmp.SetPrefSize(
aLogicalSize );
+ //aFillBmp.SetPrefMapMode(
MAP_100TH_MM );
+
//p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
}
else
{
@@ -557,7 +568,10 @@ SdrObject* EnhancedCustomShape3d::Create
p3DObj->SetMergedItem(
Svx3DCloseFrontItem( sal_False ) );
p3DObj->SetMergedItem(
Svx3DCloseBackItem( sal_False ) );
pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj(
a3DDefaultAttr, aPolyPoly, 10 );
+
+ // #122777# depth 0 is okay for planes when using
double-sided
+ p3DObj = new E3dExtrudeObj(
a3DDefaultAttr, aPolyPoly, 0 );
+
p3DObj->NbcSetLayer(
pShape2d->GetLayer() );
p3DObj->SetMergedItemSet( aLocalSet );