Skip to content

Commit

Permalink
reduce if block
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Mar 29, 2020
1 parent ce2e206 commit 18099ae
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/plots/cartesian/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,9 @@ module.exports = function setConvert(ax, fullLayout) {
if(rl0 > rl1) flip = !flip;
if(flip) ax._rangebreaks.reverse();
var sign = flip ? -1 : 1;
ax._m2 = sign * ax._length / (Math.abs(rl1 - rl0) - ax._lBreaks);

if(isY) {
// N.B. top to bottom (negative coord, positive px direction)
ax._B.push(-ax._m2 * rl1);
} else {
ax._B.push(-ax._m2 * rl0);
}

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

0 comments on commit 18099ae

Please sign in to comment.