Skip to content

Commit 19d1066

Browse files
committed
Check if element is empty before drawing
1 parent 3d7f8dc commit 19d1066

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/JSRoot.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
/** @summary JSROOT version date
107107
* @desc Release date in format day/month/year like "6/01/2021"*/
108-
JSROOT.version_date = "7/01/2021";
108+
JSROOT.version_date = "8/01/2021";
109109

110110
/** @summary JSROOT version id and date
111111
* @desc Produced by concatenation of {@link JSROOT.version_id} and {@link JSROOT.version_date}

scripts/JSRoot.painter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,10 +2408,10 @@ JSROOT.define(['d3'], (d3) => {
24082408
ObjectPainter.prototype.startTextDrawing = function(font_face, font_size, draw_g, max_font_size) {
24092409

24102410
if (!draw_g) draw_g = this.draw_g;
2411+
if (!draw_g || draw_g.empty()) return;
24112412

2412-
let font = (font_size === 'font') ? font_face : new FontHandler(font_face, font_size);
2413-
2414-
let pp = this.getPadPainter();
2413+
let font = (font_size === 'font') ? font_face : new FontHandler(font_face, font_size),
2414+
pp = this.getPadPainter();
24152415

24162416
draw_g.call(font.func);
24172417

@@ -2421,7 +2421,7 @@ JSROOT.define(['d3'], (d3) => {
24212421
.property('text_factor', 0.)
24222422
.property('max_text_width', 0) // keep maximal text width, use it later
24232423
.property('max_font_size', max_font_size)
2424-
.property("_fast_drawing", pp && pp._fast_drawing);
2424+
.property("_fast_drawing", pp ? pp._fast_drawing : false);
24252425

24262426
if (draw_g.property("_fast_drawing"))
24272427
draw_g.property("_font_too_small", (max_font_size && (max_font_size < 5)) || (font.size < 4));

0 commit comments

Comments
 (0)