Kaydet (Commit) 45f683a4 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) jan iversen

tdf#96871 Do not force auto log Y scale to B^0

Remove tests to fix automatic Y minimum log scale to 0.

Change-Id: Ic33fbbc3d5ee86db964f74976d85e5a2e1068cca
Reviewed-on: https://gerrit.libreoffice.org/23559Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
Tested-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 5aadbc15
...@@ -369,26 +369,16 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic( ...@@ -369,26 +369,16 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
than 1, and the range has been swapped above), then: */ than 1, and the range has been swapped above), then: */
if( bAutoMinimum && (fTempMinimum > 0.0) ) if( bAutoMinimum && (fTempMinimum > 0.0) )
{ {
/* If minimum is less than 5 (i.e. original source values less than
B^5, B being the base of the scaling), or if minimum and maximum
are in different increment intervals (means, if minimum and maximum
are not both in the range [B^n,B^(n+1)] for a whole number n), set
minimum to 0, which results in B^0=1 on the axis. */
double fMinimumFloor = ::rtl::math::approxFloor( fTempMinimum ); double fMinimumFloor = ::rtl::math::approxFloor( fTempMinimum );
double fMaximumFloor = ::rtl::math::approxFloor( fTempMaximum ); double fMaximumFloor = ::rtl::math::approxFloor( fTempMaximum );
// handle the exact value B^(n+1) to be in the range [B^n,B^(n+1)] // handle the exact value B^(n+1) to be in the range [B^n,B^(n+1)]
if( ::rtl::math::approxEqual( fTempMaximum, fMaximumFloor ) ) if( ::rtl::math::approxEqual( fTempMaximum, fMaximumFloor ) )
fMaximumFloor -= 1.0; fMaximumFloor -= 1.0;
if( (fMinimumFloor < 5.0) || (fMinimumFloor < fMaximumFloor) ) if( fMinimumFloor == fMaximumFloor )
{ {
if( m_bExpandWideValuesToZero ) /* if minimum and maximum are in one increment interval, expand
fTempMinimum = 0.0;
}
/* Else (minimum and maximum are in one increment interval), expand
minimum toward 0 to make the 'shorter' data points visible. */ minimum toward 0 to make the 'shorter' data points visible. */
else
{
if( m_bExpandNarrowValuesTowardZero ) if( m_bExpandNarrowValuesTowardZero )
fTempMinimum -= 1.0; fTempMinimum -= 1.0;
} }
......
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