File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 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) {
566566 ax . _lBreaks += Math . abs ( brk . max - brk . min ) ;
567567 }
568568
569- var axReverse = rl0 > rl1 ;
570- var signAx = axReverse ? - 1 : 1 ;
571-
572569 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 ) ;
579574
580575 if ( isY ) {
581576 // N.B. top to bottom (negative coord, positive px direction)
@@ -586,7 +581,10 @@ module.exports = function setConvert(ax, fullLayout) {
586581
587582 for ( i = 0 ; i < ax . _rangebreaks . length ; i ++ ) {
588583 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+ ) ;
590588 }
591589
592590 // fill pixel (i.e. 'p') min/max here,
You can’t perform that action at this time.
0 commit comments