diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 10:20:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 15:46:47 +0200 |
commit | 1b1afc10f4d90e37c5e81961b8b8902133e65b00 (patch) | |
tree | fb6f68d743b334b8df4fc374afe68dc49fd6cbb8 /svtools | |
parent | cc233992dfe0fa9732c24774852d037d161546ce (diff) |
Fraction: make conversion operators and constructor explicit
and simplify some of the calculations that needed to be changed.
Which resulted in one unit test needing to change by one pixel,
let's hope not an indication of a real problem.
Change-Id: Ie56434f35f4e58d21ee6f671392e93dc7542fca3
Reviewed-on: https://gerrit.libreoffice.org/42240
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/filter/DocumentToGraphicRenderer.cxx | 4 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx index 6c95747ef09d..93b6000029e9 100644 --- a/svtools/source/filter/DocumentToGraphicRenderer.cxx +++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx @@ -150,8 +150,8 @@ Graphic DocumentToGraphicRenderer::renderToGraphic( OutputDevice* pOutputDev = VCLUnoHelper::GetOutputDevice( xDevice ); pOutputDev->SetAntialiasing(pOutputDev->GetAntialiasing() | AntialiasingFlags::EnableB2dDraw); MapMode mm = pOutputDev->GetMapMode(); - mm.SetScaleX( fScaleX ); - mm.SetScaleY( fScaleY ); + mm.SetScaleX( Fraction(fScaleX) ); + mm.SetScaleY( Fraction(fScaleY) ); pOutputDev->SetMapMode( mm ); aMtf.Record( pOutputDev ); diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 41e606535600..a77fbd2b5cc6 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -623,8 +623,8 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal if ( aMtfSize.Width() && aMtfSize.Height() ) { MapMode aNewMapMode( MapUnit::Map100thMM ); - aNewMapMode.SetScaleX( static_cast< double >( aLogicalSize.Width ) / static_cast< double >( aMtfSize.Width() ) ); - aNewMapMode.SetScaleY( static_cast< double >( aLogicalSize.Height ) / static_cast< double >( aMtfSize.Height() ) ); + aNewMapMode.SetScaleX( Fraction( aLogicalSize.Width, aMtfSize.Width() ) ); + aNewMapMode.SetScaleY( Fraction( aLogicalSize.Height, aMtfSize.Height() ) ); aDummyVDev->EnableOutput( false ); aDummyVDev->SetMapMode( aNewMapMode ); |