Skip to content

Commit 18099ae

Browse files
committed
reduce if block
1 parent ce2e206 commit 18099ae

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/plots/cartesian/set_convert.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -570,15 +570,9 @@ module.exports = function setConvert(ax, fullLayout) {
570570
if(rl0 > rl1) flip = !flip;
571571
if(flip) ax._rangebreaks.reverse();
572572
var sign = flip ? -1 : 1;
573-
ax._m2 = sign * ax._length / (Math.abs(rl1 - rl0) - ax._lBreaks);
574-
575-
if(isY) {
576-
// N.B. top to bottom (negative coord, positive px direction)
577-
ax._B.push(-ax._m2 * rl1);
578-
} else {
579-
ax._B.push(-ax._m2 * rl0);
580-
}
581573

574+
ax._m2 = sign * ax._length / (Math.abs(rl1 - rl0) - ax._lBreaks);
575+
ax._B.push(-ax._m2 * (isY ? rl1 : rl0));
582576
for(i = 0; i < ax._rangebreaks.length; i++) {
583577
brk = ax._rangebreaks[i];
584578
ax._B.push(

0 commit comments

Comments
 (0)