File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -566,16 +566,11 @@ module.exports = function setConvert(ax, fullLayout) {
566
566
ax . _lBreaks += Math . abs ( brk . max - brk . min ) ;
567
567
}
568
568
569
- var axReverse = rl0 > rl1 ;
570
- var signAx = axReverse ? - 1 : 1 ;
571
-
572
569
var flip = isY ;
573
- if ( ax . range [ 0 ] > ax . range [ 1 ] ) flip = ! flip ;
574
- if ( flip ) {
575
- ax . _rangebreaks . reverse ( ) ;
576
- }
577
-
578
- ax . _m2 = ( isY ? - 1 : 1 ) * ax . _length / ( rl1 - rl0 - ax . _lBreaks * signAx ) ;
570
+ if ( rl0 > rl1 ) flip = ! flip ;
571
+ if ( flip ) ax . _rangebreaks . reverse ( ) ;
572
+ var sign = flip ? - 1 : 1 ;
573
+ ax . _m2 = sign * ax . _length / ( Math . abs ( rl1 - rl0 ) - ax . _lBreaks ) ;
579
574
580
575
if ( isY ) {
581
576
// N.B. top to bottom (negative coord, positive px direction)
@@ -586,7 +581,10 @@ module.exports = function setConvert(ax, fullLayout) {
586
581
587
582
for ( i = 0 ; i < ax . _rangebreaks . length ; i ++ ) {
588
583
brk = ax . _rangebreaks [ i ] ;
589
- ax . _B . push ( ax . _B [ ax . _B . length - 1 ] - ( isY ? - 1 : 1 ) * ax . _m2 * ( brk . max - brk . min ) * signAx ) ;
584
+ ax . _B . push (
585
+ ax . _B [ ax . _B . length - 1 ] -
586
+ sign * ax . _m2 * ( brk . max - brk . min )
587
+ ) ;
590
588
}
591
589
592
590
// fill pixel (i.e. 'p') min/max here,
You can’t perform that action at this time.
0 commit comments