Skip to content

Commit 59e7280

Browse files
committed
Fix - for TH2 box draw option draw at least 1px rect for non-empty bin
1 parent 7c76ff7 commit 59e7280

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/JSRootPainter.more.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,14 +3629,12 @@
36293629
dgrx = zdiff * xfactor * ww;
36303630
dgry = zdiff * yfactor * hh;
36313631

3632-
ww = Math.round(ww - 2*dgrx);
3633-
hh = Math.round(hh - 2*dgry);
3632+
ww = Math.max(Math.round(ww - 2*dgrx), 1);
3633+
hh = Math.max(Math.round(hh - 2*dgry), 1);
36343634

3635-
if ((ww > 0) && (hh > 0)) {
3636-
if (colPaths[i]===undefined) colPaths[i] = "";
3637-
colPaths[i] += "M" + Math.round(handle.grx[i] + dgrx) + "," + Math.round(handle.gry[j+1] + dgry) +
3638-
"v" + hh + "h" + ww + "v-" + hh + "z";
3639-
}
3635+
if (colPaths[i]===undefined) colPaths[i] = "";
3636+
colPaths[i] += "M" + Math.round(handle.grx[i] + dgrx) + "," + Math.round(handle.gry[j+1] + dgry) +
3637+
"v" + hh + "h" + ww + "v-" + hh + "z";
36403638
}
36413639
}
36423640

0 commit comments

Comments
 (0)