summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-08-30 14:31:29 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-08-30 14:37:27 +0200
commit21ee132af1b888f50a9d916337011879570ca357 (patch)
treed9bb87b2f8bdd9fb5ca82963b02e704b0e7072c2 /cppcanvas
parentf8426f505316d08f35d8a7cf8dbfd6a3c60db3db (diff)
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 2b700a710e44d2d09f45793f5f2448268e66d4fe. Revert "Pass also the bounding box in device units to the EMF+ part" This reverts commit f387c5da5a824df6cf2874155c13445a86804475.
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/inc/implrenderer.hxx5
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx15
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx5
3 files changed, 19 insertions, 6 deletions
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 63cce82fbab6..79a2967f88d6 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -286,6 +286,7 @@ static float GetSwapFloat( SvStream& rSt )
ActionVector maActions;
/* EMF+ */
+ XForm aBaseTransform;
XForm aWorldTransform;
EMFPObject* aObjects [256];
float fPageScale;
@@ -294,10 +295,6 @@ static float GetSwapFloat( SvStream& rSt )
sal_Int32 nHDPI;
sal_Int32 nVDPI;
/* EMF+ emf header info */
- sal_Int32 nBoundsLeft;
- sal_Int32 nBoundsTop;
- sal_Int32 nBoundsRight;
- sal_Int32 nBoundsBottom;
sal_Int32 nFrameLeft;
sal_Int32 nFrameTop;
sal_Int32 nFrameRight;
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 384dd2c0555e..a88ae1277da2 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -865,6 +865,9 @@ namespace cppcanvas
x -= nFrameLeft;
y -= nFrameTop;
+ x *= aBaseTransform.eM11;
+ y *= aBaseTransform.eM22;
+
return ::basegfx::B2DPoint (x, y);
}
@@ -877,6 +880,9 @@ namespace cppcanvas
MapToDevice (w, h);
+ w *= aBaseTransform.eM11;
+ h *= aBaseTransform.eM22;
+
return ::basegfx::B2DSize (w, h);
}
@@ -927,6 +933,7 @@ namespace cppcanvas
::basegfx::B2DHomMatrix aTextureTransformation;
::basegfx::B2DHomMatrix aWorldTransformation;
+ ::basegfx::B2DHomMatrix aBaseTransformation;
rendering::Texture aTexture;
aWorldTransformation.set (0, 0, aWorldTransform.eM11);
@@ -936,6 +943,13 @@ namespace cppcanvas
aWorldTransformation.set (1, 1, aWorldTransform.eM22);
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) {
aTextureTransformation.scale (brush->areaWidth, brush->areaHeight);
aTextureTransformation.translate (brush->areaX, brush->areaY);
@@ -962,6 +976,7 @@ namespace cppcanvas
aTextureTransformation.scale (100.0*nMmX/nPixX, 100.0*nMmY/nPixY);
aTextureTransformation.translate (-nFrameLeft, -nFrameTop);
aTextureTransformation *= rState.mapModeTransform;
+ aTextureTransformation *= aBaseTransformation;
aTexture.RepeatModeX = rendering::TexturingMode::CLAMP;
aTexture.RepeatModeY = rendering::TexturingMode::CLAMP;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 17c68c4e5072..c9489afd244c 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1787,12 +1787,13 @@ namespace cppcanvas
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;
SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom);
rMF >> nPixX >> nPixY >> nMmX >> nMmY;
SAL_INFO ("cppcanvas.emf", "EMF+ ref device pixel size: " << nPixX << "x" << nPixY << " mm size: " << nMmX << "x" << nMmY);
+
+ rMF >> aBaseTransform;
+ //aWorldTransform.Set (aBaseTransform);
}
}
break;