diff options
-rw-r--r-- | vcl/source/gdi/outmap.cxx | 38 |
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 |