Skip to content

Commit 1dbcc9f

Browse files
committed
With enlarge canvas ignore status line - does not seen at all.
1 parent e4bb8d6 commit 1dbcc9f

File tree

3 files changed

+17
-34
lines changed

3 files changed

+17
-34
lines changed

scripts/JSRoot3DPainter.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@
103103
this.tt.style.left = (l + 3) + 'px';
104104
};
105105

106-
this.show = function(v, mouse_pos) {
106+
this.show = function(v, mouse_pos, ignore_status) {
107107
// if (JSROOT.gStyle.Tooltip <= 0) return;
108108
if (!v || (v==="")) return this.hide();
109109

110-
if (JSROOT.Painter.ShowStatus) {
110+
if (JSROOT.Painter.ShowStatus && !ignore_status) {
111111
this.hide();
112112

113113
var name = "", title = "", coord = "", info = "";
@@ -133,21 +133,10 @@
133133

134134
if (this.tt === null) {
135135
this.tt = document.createElement('div');
136-
this.tt.setAttribute('class', 'jsroot');
137-
var t = document.createElement('div');
138-
t.setAttribute('class', 'tt3d_border');
136+
this.tt.setAttribute('class', 'jsroot_tt3d_main');
139137
this.cont = document.createElement('div');
140-
this.cont.setAttribute('class', 'tt3d_cont');
141-
var b = document.createElement('div');
142-
b.setAttribute('class', 'tt3d_border');
143-
this.tt.appendChild(t);
138+
this.cont.setAttribute('class', 'jsroot_tt3d_cont');
144139
this.tt.appendChild(this.cont);
145-
this.tt.appendChild(b);
146-
this.tt.style.opacity = 1;
147-
this.tt.style.filter = 'alpha(opacity=1)';
148-
this.tt.style.position = 'absolute';
149-
this.tt.style.display = 'block';
150-
this.tt.style.overflow = 'hidden';
151140
this.parent.appendChild(this.tt);
152141
}
153142

@@ -371,16 +360,16 @@
371360
return;
372361
}
373362

374-
var mouse = this.GetMousePos(evnt, {});
375363
evnt.preventDefault();
376364

377-
var intersects = this.GetIntersects(mouse);
378-
379-
var tip = this.ProcessMouseMove(intersects);
365+
var mouse = this.GetMousePos(evnt, {}),
366+
intersects = this.GetIntersects(mouse),
367+
tip = this.ProcessMouseMove(intersects);
380368

381369
this.cursor_changed = false;
382370
if (tip) {
383-
this.tooltip.show(tip, mouse);
371+
var ignore_status = (this.painter && this.painter.enlarge_main && this.painter.enlarge_main('state')==='on');
372+
this.tooltip.show(tip, mouse, ignore_status);
384373
this.tooltip.pos(evnt)
385374
} else {
386375
this.tooltip.hide();

scripts/JSRootPainter.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,16 +2556,9 @@
25562556
JSROOT.TObjectPainter.prototype.ShowObjectStatus = function() {
25572557
// method called normally when mouse enter main object element
25582558

2559-
if (!JSROOT.Painter.ShowStatus) return;
2560-
25612559
var obj = this.GetObject();
2562-
if (!obj) return;
25632560

2564-
//var pnt = null, can = this.svg_canvas();
2565-
//if (!can.empty()) {
2566-
// pnt = d3.mouse(can.node());
2567-
// pnt = { x: pnt[0], y: pnt[1] };
2568-
// }
2561+
if (!obj || !JSROOT.Painter.ShowStatus) return;
25692562

25702563
JSROOT.Painter.ShowStatus(this.GetItemName() || obj.fName, obj.fTitle || obj._typename, obj._typename);
25712564
}
@@ -3232,7 +3225,7 @@
32323225
var layer = this.svg_layer("stat_layer"),
32333226
hintsg = layer.select(".objects_hints"); // group with all tooltips
32343227

3235-
if (JSROOT.Painter.ShowStatus) {
3228+
if (JSROOT.Painter.ShowStatus && (this.enlarge_main('state')!=='on')) {
32363229
hintsg.remove();
32373230

32383231
var title = "", name = "", coordinates = "", info = "";

style/JSRootPainter.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,15 @@
348348
tooltip style for 3d drawings
349349
--------------------------------------------------*/
350350

351-
.jsroot .tt3d_border {
351+
.jsroot_tt3d_main {
352+
opacity: 1;
353+
filter: alpha(opacity=1);
354+
position: absolute;
352355
display: block;
353-
height: 5px;
354-
margin-left: 5px;
355356
overflow: hidden;
357+
z-index: 101;
356358
}
357-
358-
.jsroot .tt3d_cont {
359+
.jsroot_tt3d_cont {
359360
display: block;
360361
padding: 2px 12px 3px 7px;
361362
margin-left: 5px;

0 commit comments

Comments
 (0)