summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-06-18 22:32:35 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-06-18 22:38:41 +0300
commitdaaa550121a97d80e1ab43cbd5c73da6915e4ac4 (patch)
treef4842b51515bfb2c51354adb38f1b6e48839b1e9 /vcl/source
parent8dd75128a5a7e068ae63f3d1cc6b41410f7d7122 (diff)
Pass also scale and offset to createScreenCompatibleDeviceUsingBuffer()
Pass on to VirtualDevice where used to set the MapMode of the device appropriately. Adapt DocumentLoader, use to scale the page rendering to exactly fit the virtual device. Change-Id: I4b0bc67e12114d3d9d493ff1aca2ef5d2cc78912
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/virdev.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 93aec4fd94e1..2c67355888f2 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -368,16 +368,15 @@ sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bEras
return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray() );
}
-sal_Bool VirtualDevice::SetOutputSizePixelAndBuffer( const Size& rNewSize, const basebmp::RawMemorySharedArray &pBuffer )
+sal_Bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, const basebmp::RawMemorySharedArray &pBuffer )
{
- // Is this the place to put in scaling and offsetting, passed in as parameters from createScreenCompatibleDeviceUsingBuffer?
- // Bogus test just to see that something happens:
- // if (pBuffer) {
- // MapMode mm = GetMapMode();
- // mm.SetScaleX(Fraction(4, 1));
- // mm.SetScaleY(Fraction(4, 1));
- // SetMapMode(mm);
- //}
+ if (pBuffer) {
+ MapMode mm = GetMapMode();
+ mm.SetOrigin( rNewOffset );
+ mm.SetScaleX( rScale );
+ mm.SetScaleY( rScale );
+ SetMapMode( mm );
+ }
return ImplSetOutputSizePixel( rNewSize, sal_True, pBuffer);
}