summaryrefslogtreecommitdiffstats
path: root/cppcanvas/source/mtfrenderer/emfplus.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppcanvas/source/mtfrenderer/emfplus.cxx')
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 8ccb75bfdad1..91c95607a055 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -825,6 +825,11 @@ namespace cppcanvas
y = 100*nMmY*y/nPixY;
}
+ ::basegfx::B2DPoint ImplRenderer::Map (::basegfx::B2DPoint& p)
+ {
+ return Map (p.getX (), p.getY ());
+ }
+
::basegfx::B2DPoint ImplRenderer::Map (double ix, double iy)
{
double x, y;
@@ -858,6 +863,29 @@ namespace cppcanvas
return ::basegfx::B2DSize (w, h);
}
+ ::basegfx::B2DRange ImplRenderer::MapRectangle (double ix, double iy, double iwidth, double iheight)
+ {
+ double x, y, w, h;
+
+ x = ix*aWorldTransform.eM11 + iy*aWorldTransform.eM21 + aWorldTransform.eDx;
+ y = ix*aWorldTransform.eM12 + iy*aWorldTransform.eM22 + aWorldTransform.eDy;
+ w = iwidth*aWorldTransform.eM11 + iheight*aWorldTransform.eM21;
+ h = iwidth*aWorldTransform.eM12 + iheight*aWorldTransform.eM22;
+
+ MapToDevice (x, y);
+ MapToDevice (w, h);
+
+ x -= nFrameLeft;
+ y -= nFrameTop;
+
+ x *= aBaseTransform.eM11;
+ y *= aBaseTransform.eM22;
+ w *= aBaseTransform.eM11;
+ h *= aBaseTransform.eM22;
+
+ return ::basegfx::B2DRange (x, y, x + w, y + h);
+ }
+
#define COLOR(x) \
::vcl::unotools::colorToDoubleSequence( ::Color (0xff - (x >> 24), \
(x >> 16) & 0xff, \