diff options
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 5e53141995e2..588641713110 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2331,8 +2331,9 @@ void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::sta // The implicit conversion from float to double can result in a precision loss, i.e. 1.2 is converted to // 1.200000000047something. To prevent this, we convert explicitly to double, and round it. double nZoom( fZoomX ); - nZoom = ::rtl::math::round( nZoom, 4 ); - GetWindow()->SetZoom( Fraction( nZoom ) ); + Fraction aZoom(::rtl::math::round(nZoom, 4)); + aZoom.ReduceInaccurate(10); // to avoid runovers and BigInt mapping + GetWindow()->SetZoom(aZoom); } } |