From daaa550121a97d80e1ab43cbd5c73da6915e4ac4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 18 Jun 2012 22:32:35 +0300 Subject: 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 --- vcl/source/gdi/virdev.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'vcl/source') 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); } -- cgit