Skip to content

Commit 64babff

Browse files
committed
Fix problem with TH2 col drawing
When bins size smaller than 1 pixel, it may be not drawn correctly Force at least 1 pixel size when it should be drawn
1 parent 5f05219 commit 64babff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/JSRootPainter.hist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4828,7 +4828,7 @@
48284828

48294829
dx = handle.grx[i+1] - handle.grx[i];
48304830
x1 = Math.round(handle.grx[i] + dx*handle.xbar1);
4831-
dx = Math.round(dx*(handle.xbar2-handle.xbar1));
4831+
dx = Math.round(dx*(handle.xbar2-handle.xbar1)) || 1;
48324832

48334833
for (j = handle.j1; j < handle.j2; ++j) {
48344834
binz = histo.getBinContent(i + 1, j + 1);
@@ -4841,7 +4841,7 @@
48414841

48424842
dy = handle.gry[j]-handle.gry[j+1];
48434843
y2 = Math.round(handle.gry[j+1] + dy*handle.ybar1);
4844-
dy = Math.round(dy*(handle.ybar2-handle.ybar1));
4844+
dy = Math.round(dy*(handle.ybar2-handle.ybar1)) || 1;
48454845

48464846
cmd1 = "M"+x1+","+y2;
48474847
if (colPaths[colindx] === undefined) {

0 commit comments

Comments
 (0)