diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 58f7fe3980c8..4281693e29fe 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -964,21 +964,30 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, // that VirtualDevices use a DPI of 96. We might as well do this // calculation now, rather than after another dimension conversion, // to minimise errors. - Fraction scaleX = Fraction( nOutputWidth, 96 ) * Fraction(1440L) / + // TODO: width wise we need the print scaling compensation stuff? + Fraction scaleX = Fraction( 100*nOutputWidth, 96*96 ) * Fraction(1440L) / Fraction( nTileWidth); - Fraction scaleY = Fraction( nOutputHeight, 96 ) * Fraction(1440L) / + if ( pViewData->GetDocShell() ) + { + scaleX *= pViewData->GetDocShell()->GetOutputFactor(); + } + Fraction scaleY = Fraction( 100*nOutputHeight, 96*96 ) * Fraction(1440L) / Fraction( nTileHeight); rDevice.SetOutputSizePixel( Size( nOutputWidth, nOutputHeight ) ); - MapMode aMapMode( rDevice.GetMapMode() ); - aMapMode.SetMapUnit( MAP_TWIP ); - aMapMode.SetOrigin( Point( -nTilePosX, -nTilePosY ) ); - aMapMode.SetScaleX( scaleX ); - aMapMode.SetScaleY( scaleY ); + pViewData->SetZoom( scaleX, scaleY, false ); + // We now need to force a recalculation of PaintMapMode, which + // happens when ScViewData::CalcPPT is called by RefreshZoom. + pViewData->RefreshZoom(); - maPaintMapMode = aMapMode; -// rDevice.SetMapMode( aMapMode ); + // We only need to propagate the origin through to Draw() + // through the device. + MapMode aMapMode( rDevice.GetMapMode() ); + aMapMode.SetOrigin( rDevice.LogicToPixel( + Point(-nTilePosX, -nTilePosY ), + pViewData->GetPaintMapMode() ) ); + rDevice.SetMapMode( aMapMode ); ScTabViewShell* pTabViewSh = pViewData->GetViewShell(); SdrView* pDrawView = pTabViewSh->GetScDrawView(); |