Kaydet (Commit) c8dad7eb authored tarafından Michael Stahl's avatar Michael Stahl

tdf#91195: vcl: reduce MapMode Fraction precision to avoid...

... overlow in ImplMapLogicToPixel.  50 bits is still too much, 44
appears to work for exporting PNG.

DocumentToGraphicRenderer::renderToGraphic() converts a double to
Fraction which is the source of the excess precision.

Change-Id: I93b11ef3a8be1c2f816f9697e5cd33eb00f7c2f9
üst 6ea1d1d3
......@@ -193,6 +193,7 @@ void MapMode::SetScaleX( const Fraction& rScaleX )
ImplMakeUnique();
mpImplMapMode->maScaleX = rScaleX;
mpImplMapMode->maScaleX.ReduceInaccurate(44);
}
void MapMode::SetScaleY( const Fraction& rScaleY )
......@@ -200,6 +201,7 @@ void MapMode::SetScaleY( const Fraction& rScaleY )
ImplMakeUnique();
mpImplMapMode->maScaleY = rScaleY;
mpImplMapMode->maScaleY.ReduceInaccurate(44);
}
MapMode& MapMode::operator=( const MapMode& rMapMode )
......
......@@ -78,6 +78,7 @@ static Fraction ImplMakeFraction( long nN1, long nN2, long nD1, long nD2 )
aF = Fraction( i*nN1, nD1 ) * Fraction( nN2, nD2 );
}
aF.ReduceInaccurate(44);
return aF;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment