@@ -26,8 +26,11 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
2626 var plotGroup = d3 . select ( this ) ;
2727 var cd0 = cd [ 0 ] ;
2828 var trace = cd0 . trace ;
29- var fastImage = supportsPixelatedImage && ! trace . _hasZ && trace . _hasSource && xa . type === 'linear' && ya . type === 'linear' ;
30- trace . _fastImage = fastImage ;
29+ var realImage = (
30+ ( ( trace . zsmooth === 'fast' ) || ( trace . zsmooth === false && supportsPixelatedImage ) ) &&
31+ ! trace . _hasZ && trace . _hasSource && xa . type === 'linear' && ya . type === 'linear'
32+ ) ;
33+ trace . _realImage = realImage ;
3134
3235 var z = cd0 . z ;
3336 var x0 = cd0 . x0 ;
@@ -73,7 +76,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
7376 }
7477
7578 // Reduce image size when zoomed in to save memory
76- if ( ! fastImage ) {
79+ if ( ! realImage ) {
7780 var extra = 0.5 ; // half the axis size
7881 left = Math . max ( - extra * xa . _length , left ) ;
7982 right = Math . min ( ( 1 + extra ) * xa . _length , right ) ;
@@ -138,7 +141,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
138141
139142 var style = ( trace . zsmooth === false ) ? constants . pixelatedStyle : '' ;
140143
141- if ( fastImage ) {
144+ if ( realImage ) {
142145 var xRange = Lib . simpleMap ( xa . range , xa . r2l ) ;
143146 var yRange = Lib . simpleMap ( ya . range , ya . r2l ) ;
144147
@@ -194,7 +197,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
194197 canvas = drawMagnifiedPixelsOnCanvas ( function ( i , j ) { return z [ j ] [ i ] ; } ) ;
195198 href = canvas . toDataURL ( 'image/png' ) ;
196199 } else if ( trace . _hasSource ) {
197- if ( fastImage ) {
200+ if ( realImage ) {
198201 href = trace . source ;
199202 } else {
200203 var context = trace . _canvas . el . getContext ( '2d' ) ;
0 commit comments