Skip to content

Commit cb3ec9a

Browse files
committed
Optimize transform attribute of text/latex
1 parent 35d936c commit cb3ec9a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/JSRoot.painter.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,18 +2739,18 @@ JSROOT.define(['d3'], (d3) => {
27392739

27402740
// use translate and then rotate to avoid complex sign calculations
27412741
let trans = "";
2742-
if (arg.y || arg.x)
2742+
if (arg.y)
27432743
trans = "translate(" + Math.round(arg.x) + "," + Math.round(arg.y) + ")";
2744-
//else if (arg.x)
2745-
// trans = "translate(" + Math.round(arg.x) + ")";
2744+
else if (arg.x)
2745+
trans = "translate(" + Math.round(arg.x) + ")";
27462746
if (arg.rotate)
27472747
trans += " rotate(" + Math.round(arg.rotate) + ")";
27482748
if (scale !== 1)
27492749
trans += " scale(" + scale.toFixed(3) + ")";
2750-
if (arg.dy || arg.dx)
2750+
if (arg.dy)
27512751
trans += " translate(" + Math.round(arg.dx) + "," + Math.round(arg.dy) + ")";
2752-
//else if (arg.dx)
2753-
// trans += " translate(" + Math.round(arg.dx) + ")";
2752+
else if (arg.dx)
2753+
trans += " translate(" + Math.round(arg.dx) + ")";
27542754
if (trans) txt.attr("transform", trans);
27552755
});
27562756

0 commit comments

Comments
 (0)