Skip to content

Commit cda3196

Browse files
committed
Fix - correctly draw TH2 with lego option, when histogram has negative
bin content
1 parent 3b56437 commit cda3196

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Changes in 4.4.x
44
1. Fix - toggling of statbox was not working in all situations
55
2. Fix - for mouse rect zooming use only left mouse button
6+
3. Fix - correctly draw TH2 with lego option, when histogram has negative bin content
67

78

89
## Changes in 4.4.3

scripts/JSRoot3DPainter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,12 +619,13 @@
619619
for (var i = 0; i < local_bins.length; ++i) {
620620
var hh = local_bins[i];
621621
var wei = this.tz(hh.z);
622+
if (wei===0) continue;
622623

623624
// create a new mesh with cube geometry
624625
var bin = new THREE.Mesh(geom, material.clone());
625626

626627
bin.position.set(this.tx(hh.x), this.ty(hh.y), wei / 2);
627-
bin.scale.set(1,1,wei);
628+
bin.scale.set(1,1,Math.abs(wei));
628629

629630
if ((JSROOT.gStyle.Tooltip > 0) && ('tip' in hh))
630631
bin.name = hh.tip.replace(/(?:\r\n|\r|\n)/g, '<br/>');

0 commit comments

Comments
 (0)