Skip to content

Commit e819224

Browse files
committed
Fix - typo in GetBinX/Y/Z for irregular axes
1 parent 10bd60c commit e819224

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/JSRootPainter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,7 +5498,7 @@
54985498
this.GetBinX = function(bin) {
54995499
var indx = Math.round(bin);
55005500
if (indx <= 0) return this.xmin;
5501-
if (indx > this.nbinsx) this.xmax;
5501+
if (indx > this.nbinsx) return this.xmax;
55025502
if (indx==bin) return this.histo.fXaxis.fXbins[indx];
55035503
var indx2 = (bin < indx) ? indx - 1 : indx + 1;
55045504
return this.histo.fXaxis.fXbins[indx] * Math.abs(bin-indx2) + this.histo.fXaxis.fXbins[indx2] * Math.abs(bin-indx);
@@ -5528,7 +5528,7 @@
55285528
this.GetBinY = function(bin) {
55295529
var indx = Math.round(bin);
55305530
if (indx <= 0) return this.ymin;
5531-
if (indx > this.nbinsy) this.ymax;
5531+
if (indx > this.nbinsy) return this.ymax;
55325532
if (indx==bin) return this.histo.fYaxis.fXbins[indx];
55335533
var indx2 = (bin < indx) ? indx - 1 : indx + 1;
55345534
return this.histo.fYaxis.fXbins[indx] * Math.abs(bin-indx2) + this.histo.fYaxis.fXbins[indx2] * Math.abs(bin-indx);
@@ -5555,7 +5555,7 @@
55555555
this.GetBinZ = function(bin) {
55565556
var indx = Math.round(bin);
55575557
if (indx <= 0) return this.zmin;
5558-
if (indx > this.nbinsz) this.zmax;
5558+
if (indx > this.nbinsz) return this.zmax;
55595559
if (indx==bin) return this.histo.fZaxis.fXbins[indx];
55605560
var indx2 = (bin < indx) ? indx - 1 : indx + 1;
55615561
return this.histo.fZaxis.fXbins[indx] * Math.abs(bin-indx2) + this.histo.fZaxis.fXbins[indx2] * Math.abs(bin-indx);

0 commit comments

Comments
 (0)