summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-05 16:09:54 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-05 16:09:54 +0000
commita5d7395b1eb120cae72c80320710ff16c1c20b3e (patch)
tree388c742daf9010dbbbb9aba46d33b4b1578de99a /vcl/source
parentd62c007e5bffaab0945b9ebaab35d4d051f8c937 (diff)
INTEGRATION: CWS aquavcl05_DEV300 (1.24.40); FILE MERGED
2008/02/12 10:13:46 hdu 1.24.40.1: #i86038# added subpixel-accurate pixel<->logic conversions
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/outmap.cxx38
1 files changed, 36 insertions, 2 deletions
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index e4290c4394e4..74c112382aa3 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: outmap.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: ihi $ $Date: 2007-11-26 15:12:22 $
+ * last change: $Author: kz $ $Date: 2008-03-05 17:09:54 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -598,6 +598,15 @@ long OutputDevice::ImplLogicWidthToDevicePixel( long nWidth ) const
maThresRes.mnThresLogToPixX );
}
+float OutputDevice::ImplFloatLogicWidthToDevicePixel( float fLogicWidth) const
+{
+ if( !mbMap)
+ return fLogicWidth;
+ // TODO: consolidate the calculation into one multiplication
+ float fPixelWidth = (fLogicWidth * mnDPIX * maMapRes.mnMapScNumX) / maMapRes.mnMapScDenomX;
+ return fPixelWidth;
+}
+
// -----------------------------------------------------------------------
long OutputDevice::ImplLogicHeightToDevicePixel( long nHeight ) const
@@ -610,6 +619,14 @@ long OutputDevice::ImplLogicHeightToDevicePixel( long nHeight ) const
maThresRes.mnThresLogToPixY );
}
+float OutputDevice::ImplFloatLogicHeightToDevicePixel( float fLogicHeight) const
+{
+ if( !mbMap)
+ return fLogicHeight;
+ float fPixelHeight = (fLogicHeight * mnDPIY * maMapRes.mnMapScNumY) / maMapRes.mnMapScDenomY;
+ return fPixelHeight;
+}
+
// -----------------------------------------------------------------------
long OutputDevice::ImplDevicePixelToLogicWidth( long nWidth ) const
@@ -622,6 +639,14 @@ long OutputDevice::ImplDevicePixelToLogicWidth( long nWidth ) const
maThresRes.mnThresPixToLogX );
}
+float OutputDevice::ImplFloatDevicePixelToLogicWidth( float fPixelWidth) const
+{
+ if( !mbMap)
+ return fPixelWidth;
+ float fLogicHeight = (fPixelWidth * maMapRes.mnMapScDenomX) / (mnDPIX * maMapRes.mnMapScNumX);
+ return fLogicHeight;
+}
+
// -----------------------------------------------------------------------
long OutputDevice::ImplDevicePixelToLogicHeight( long nHeight ) const
@@ -634,6 +659,15 @@ long OutputDevice::ImplDevicePixelToLogicHeight( long nHeight ) const
maThresRes.mnThresPixToLogY );
}
+float OutputDevice::ImplFloatDevicePixelToLogicHeight( float fPixelHeight) const
+{
+ if( !mbMap)
+ return fPixelHeight;
+ float fLogicHeight = (fPixelHeight * maMapRes.mnMapScDenomY) / (mnDPIY * maMapRes.mnMapScNumY);
+ return fLogicHeight;
+}
+
+
// -----------------------------------------------------------------------
Point OutputDevice::ImplLogicToDevicePixel( const Point& rLogicPt ) const