Skip to content

Commit 2d68e1f

Browse files
committed
Optimize code in range
1 parent ce92f13 commit 2d68e1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/gpad/TFramePainter.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,12 +1830,12 @@ class TFramePainter extends ObjectPainter {
18301830

18311831
let aname = name;
18321832
if (this.swap_xy) aname = (name === 'x') ? 'y' : 'x';
1833-
const smin = `scale_${aname}min`,
1834-
smax = `scale_${aname}max`;
1833+
const smin = this[`scale_${aname}min`],
1834+
smax = this[`scale_${aname}max`];
18351835

1836-
eps = (this[smax] - this[smin]) * 1e-7;
1836+
eps = (smax - smin) * 1e-7;
18371837

1838-
if ((Math.abs(umin - this[smin]) > eps) || (Math.abs(umax - this[smax]) > eps)) {
1838+
if ((Math.abs(umin - smin) > eps) || (Math.abs(umax - smax) > eps)) {
18391839
this[`zoom_${aname}min`] = umin;
18401840
this[`zoom_${aname}max`] = umax;
18411841
}

0 commit comments

Comments
 (0)