Kaydet (Commit) 21ee132a authored tarafından Fridrich Štrba's avatar Fridrich Štrba

Revert some random work-in-progress that is most probably bitrotten

Revert "EMF+: aBaseTransform is a hardcoded identity matrix, don't bother with it"

This reverts commit 2b700a71.

Revert "Pass also the bounding box in device units to the EMF+ part"

This reverts commit f387c5da.
üst f8426f50
...@@ -286,6 +286,7 @@ static float GetSwapFloat( SvStream& rSt ) ...@@ -286,6 +286,7 @@ static float GetSwapFloat( SvStream& rSt )
ActionVector maActions; ActionVector maActions;
/* EMF+ */ /* EMF+ */
XForm aBaseTransform;
XForm aWorldTransform; XForm aWorldTransform;
EMFPObject* aObjects [256]; EMFPObject* aObjects [256];
float fPageScale; float fPageScale;
...@@ -294,10 +295,6 @@ static float GetSwapFloat( SvStream& rSt ) ...@@ -294,10 +295,6 @@ static float GetSwapFloat( SvStream& rSt )
sal_Int32 nHDPI; sal_Int32 nHDPI;
sal_Int32 nVDPI; sal_Int32 nVDPI;
/* EMF+ emf header info */ /* EMF+ emf header info */
sal_Int32 nBoundsLeft;
sal_Int32 nBoundsTop;
sal_Int32 nBoundsRight;
sal_Int32 nBoundsBottom;
sal_Int32 nFrameLeft; sal_Int32 nFrameLeft;
sal_Int32 nFrameTop; sal_Int32 nFrameTop;
sal_Int32 nFrameRight; sal_Int32 nFrameRight;
......
...@@ -865,6 +865,9 @@ namespace cppcanvas ...@@ -865,6 +865,9 @@ namespace cppcanvas
x -= nFrameLeft; x -= nFrameLeft;
y -= nFrameTop; y -= nFrameTop;
x *= aBaseTransform.eM11;
y *= aBaseTransform.eM22;
return ::basegfx::B2DPoint (x, y); return ::basegfx::B2DPoint (x, y);
} }
...@@ -877,6 +880,9 @@ namespace cppcanvas ...@@ -877,6 +880,9 @@ namespace cppcanvas
MapToDevice (w, h); MapToDevice (w, h);
w *= aBaseTransform.eM11;
h *= aBaseTransform.eM22;
return ::basegfx::B2DSize (w, h); return ::basegfx::B2DSize (w, h);
} }
...@@ -927,6 +933,7 @@ namespace cppcanvas ...@@ -927,6 +933,7 @@ namespace cppcanvas
::basegfx::B2DHomMatrix aTextureTransformation; ::basegfx::B2DHomMatrix aTextureTransformation;
::basegfx::B2DHomMatrix aWorldTransformation; ::basegfx::B2DHomMatrix aWorldTransformation;
::basegfx::B2DHomMatrix aBaseTransformation;
rendering::Texture aTexture; rendering::Texture aTexture;
aWorldTransformation.set (0, 0, aWorldTransform.eM11); aWorldTransformation.set (0, 0, aWorldTransform.eM11);
...@@ -936,6 +943,13 @@ namespace cppcanvas ...@@ -936,6 +943,13 @@ namespace cppcanvas
aWorldTransformation.set (1, 1, aWorldTransform.eM22); aWorldTransformation.set (1, 1, aWorldTransform.eM22);
aWorldTransformation.set (1, 2, aWorldTransform.eDy); aWorldTransformation.set (1, 2, aWorldTransform.eDy);
aBaseTransformation.set (0, 0, aBaseTransform.eM11);
aBaseTransformation.set (0, 1, aBaseTransform.eM21);
aBaseTransformation.set (0, 2, aBaseTransform.eDx);
aBaseTransformation.set (1, 0, aBaseTransform.eM12);
aBaseTransformation.set (1, 1, aBaseTransform.eM22);
aBaseTransformation.set (1, 2, aBaseTransform.eDy);
if (brush->type == 4) { if (brush->type == 4) {
aTextureTransformation.scale (brush->areaWidth, brush->areaHeight); aTextureTransformation.scale (brush->areaWidth, brush->areaHeight);
aTextureTransformation.translate (brush->areaX, brush->areaY); aTextureTransformation.translate (brush->areaX, brush->areaY);
...@@ -962,6 +976,7 @@ namespace cppcanvas ...@@ -962,6 +976,7 @@ namespace cppcanvas
aTextureTransformation.scale (100.0*nMmX/nPixX, 100.0*nMmY/nPixY); aTextureTransformation.scale (100.0*nMmX/nPixX, 100.0*nMmY/nPixY);
aTextureTransformation.translate (-nFrameLeft, -nFrameTop); aTextureTransformation.translate (-nFrameLeft, -nFrameTop);
aTextureTransformation *= rState.mapModeTransform; aTextureTransformation *= rState.mapModeTransform;
aTextureTransformation *= aBaseTransformation;
aTexture.RepeatModeX = rendering::TexturingMode::CLAMP; aTexture.RepeatModeX = rendering::TexturingMode::CLAMP;
aTexture.RepeatModeY = rendering::TexturingMode::CLAMP; aTexture.RepeatModeY = rendering::TexturingMode::CLAMP;
......
...@@ -1787,12 +1787,13 @@ namespace cppcanvas ...@@ -1787,12 +1787,13 @@ namespace cppcanvas
SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ); SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ);
rMF >> nBoundsLeft >> nBoundsTop >> nBoundsRight >> nBoundsBottom;
SAL_INFO ("cppcanvas.emf", "EMF+ picture bounds: " << nBoundsLeft << "," << nBoundsTop << " - " << nBoundsRight << "," << nBoundsBottom);
rMF >> nFrameLeft >> nFrameTop >> nFrameRight >> nFrameBottom; rMF >> nFrameLeft >> nFrameTop >> nFrameRight >> nFrameBottom;
SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom); SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom);
rMF >> nPixX >> nPixY >> nMmX >> nMmY; rMF >> nPixX >> nPixY >> nMmX >> nMmY;
SAL_INFO ("cppcanvas.emf", "EMF+ ref device pixel size: " << nPixX << "x" << nPixY << " mm size: " << nMmX << "x" << nMmY); SAL_INFO ("cppcanvas.emf", "EMF+ ref device pixel size: " << nPixX << "x" << nPixY << " mm size: " << nMmX << "x" << nMmY);
rMF >> aBaseTransform;
//aWorldTransform.Set (aBaseTransform);
} }
} }
break; break;
......
...@@ -2233,24 +2233,26 @@ void WinMtfOutput::PassEMFPlusHeaderInfo() ...@@ -2233,24 +2233,26 @@ void WinMtfOutput::PassEMFPlusHeaderInfo()
EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS header info\n")); EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS header info\n"));
SvMemoryStream mem; SvMemoryStream mem;
sal_Int32 nDevLeft, nDevRight, nDevTop, nDevBottom;
sal_Int32 nLeft, nRight, nTop, nBottom; sal_Int32 nLeft, nRight, nTop, nBottom;
nDevLeft = mrclBounds.Left();
nDevRight = mrclBounds.Right();
nDevTop = mrclBounds.Top();
nDevBottom = mrclBounds.Bottom();
nLeft = mrclFrame.Left(); nLeft = mrclFrame.Left();
nTop = mrclFrame.Top(); nTop = mrclFrame.Top();
nRight = mrclFrame.Right(); nRight = mrclFrame.Right();
nBottom = mrclFrame.Bottom(); nBottom = mrclFrame.Bottom();
// emf header info // emf header info
mem << nDevLeft << nDevTop << nDevRight << nDevBottom;
mem << nLeft << nTop << nRight << nBottom; mem << nLeft << nTop << nRight << nBottom;
mem << mnPixX << mnPixY << mnMillX << mnMillY; mem << mnPixX << mnPixY << mnMillX << mnMillY;
float one, zero;
one = 1;
zero = 0;
// add transformation matrix to be used in vcl's metaact.cxx for
// rotate and scale operations
mem << one << zero << zero << one << zero << zero;
// need to flush the stream, otherwise GetEndOfData will return 0 // need to flush the stream, otherwise GetEndOfData will return 0
// on windows where the function parameters are probably resolved in reverse order // on windows where the function parameters are probably resolved in reverse order
mem.Flush(); mem.Flush();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment