|
3055 | 3055 |
|
3056 | 3056 | JSROOT.TPavePainter.prototype.Redraw = function() { |
3057 | 3057 | // if pavetext artificially disabled, do not redraw it |
| 3058 | + |
3058 | 3059 | if (this.Enabled) { |
3059 | 3060 | this.FillStatistic(); |
3060 | 3061 | this.DrawPaveText(); |
|
3064 | 3065 | } |
3065 | 3066 |
|
3066 | 3067 | JSROOT.Painter.drawPaveText = function(divid, pavetext) { |
| 3068 | + |
3067 | 3069 | var painter = new JSROOT.TPavePainter(pavetext); |
3068 | 3070 | painter.SetDivId(divid); |
3069 | 3071 |
|
|
3123 | 3125 | factor = svg.property('height_factor'); |
3124 | 3126 |
|
3125 | 3127 | if (factor!=null) { |
3126 | | - console.log('change ratio!!!'); |
3127 | 3128 | // if canvas was resize when created, resize height also now |
3128 | 3129 | h = Math.round(w * factor); |
3129 | 3130 | render_to.style('height', h+'px'); |
|
4667 | 4668 | JSROOT.THistPainter.prototype.ToggleStat = function(arg) { |
4668 | 4669 |
|
4669 | 4670 | var stat = this.FindStat(); |
| 4671 | + |
4670 | 4672 | if (stat == null) { |
4671 | 4673 | if (arg=='only-check') return false; |
4672 | 4674 | // when statbox created first time, one need to draw it |
|
4681 | 4683 | if (arg=='only-check') return statpainter.Enabled; |
4682 | 4684 |
|
4683 | 4685 | statpainter.Enabled = !statpainter.Enabled; |
4684 | | - |
4685 | 4686 | // when stat box is drawed, it always can be draw individualy while it |
4686 | 4687 | // should be last for colz RedrawPad is used |
4687 | 4688 | statpainter.Redraw(); |
|
4741 | 4742 |
|
4742 | 4743 | if ('fFunctions' in this.histo) |
4743 | 4744 | for (var i=0; i < this.histo.fFunctions.arr.length; ++i) { |
4744 | | - |
4745 | 4745 | var func = this.histo.fFunctions.arr[i]; |
4746 | 4746 |
|
4747 | | - if (func['_typename'] == 'TPaveText' || func['_typename'] == 'TPaveStats') { |
4748 | | - return func; |
4749 | | - } |
| 4747 | + if ((func._typename == 'TPaveStats') && |
| 4748 | + (func.fName == 'stats')) return func; |
4750 | 4749 | } |
4751 | 4750 |
|
4752 | 4751 | return null; |
|
5325 | 5324 | this.RedrawPad(); |
5326 | 5325 | }); |
5327 | 5326 |
|
5328 | | - menu.addchk(this.ToggleStat('only-check'), "Show statbox", this.ToggleStat.bind(this)); |
| 5327 | + menu.addchk(this.ToggleStat('only-check'), "Show statbox", function() { this.ToggleStat(); }); |
5329 | 5328 | } |
5330 | 5329 | } |
5331 | 5330 |
|
|
6567 | 6566 | if ((arg.rest == d.rest) || (arg.rest.length <= d.rest.length)) |
6568 | 6567 | return JSROOT.CallBack(call_back); |
6569 | 6568 |
|
6570 | | - // console.log('Find potential parent ' + parentname + " rest = " + d.rest); |
6571 | | - |
6572 | 6569 | return this.expand(parentname, function(res) { |
6573 | 6570 | if (!res) JSROOT.CallBack(call_back); |
6574 | 6571 | var newparentname = hpainter.itemFullName(d.last); |
6575 | | - // console.log('New parent name ' + newparentname + " sub = " + d.rest); |
6576 | 6572 | hpainter.get( { arg : newparentname + "/" + d.rest, rest : d.rest }, call_back, options); |
6577 | 6573 | }); |
6578 | 6574 | } |
|
0 commit comments