Commit 14214d27 authored by Moreau Nicolas's avatar Moreau Nicolas
Browse files

fix zoom scaling problem : min/max value of axis can be inverted when there are negative values

parent 6ee4a7d4
...@@ -1575,8 +1575,14 @@ var SAMPPNGPublishControl = (function (Control) { ...@@ -1575,8 +1575,14 @@ var SAMPPNGPublishControl = (function (Control) {
summedPixelsSpectrumChart.xAxis[0].setExtremes( summedPixelsSpectrumChart.xAxis[0].dataMin, summedPixelsSpectrumChart.xAxis[0].setExtremes( summedPixelsSpectrumChart.xAxis[0].dataMin,
summedPixelsSpectrumChart.xAxis[0].dataMax); summedPixelsSpectrumChart.xAxis[0].dataMax);
}else{ }else{
let minval = f2v(event.min * 1e9, _restfreq)/1e3; let minval = Math.round(f2v(event.min * 1e9, _restfreq)/1e3);
let maxval = f2v(event.max * 1e9, _restfreq)/1e3; let maxval = Math.round(f2v(event.max * 1e9, _restfreq)/1e3);
//exchange min/max if min > max
if(minval > maxval){
let tmp = minval;
minval = maxval;
maxval = tmp;
}
summedPixelsSpectrumChart.xAxis[0].setExtremes(minval,maxval); summedPixelsSpectrumChart.xAxis[0].setExtremes(minval,maxval);
} }
}, },
......
Supports Markdown
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