@@ -89,31 +89,31 @@ module.exports = function draw(gd) {
89
89
thisImage . attr ( 'xlink:href' , d . source ) ;
90
90
resolve ( ) ;
91
91
} else {
92
- // If not set, a `tainted canvas` error is thrown
93
- img . setAttribute ( 'crossOrigin' , 'anonymous' ) ;
94
- img . onerror = errorHandler ;
95
- img . onload = function ( ) {
96
- var canvas = document . createElement ( 'canvas' ) ;
97
- canvas . width = this . width ;
98
- canvas . height = this . height ;
92
+ // If not set, a `tainted canvas` error is thrown
93
+ img . setAttribute ( 'crossOrigin' , 'anonymous' ) ;
94
+ img . onerror = errorHandler ;
95
+ img . onload = function ( ) {
96
+ var canvas = document . createElement ( 'canvas' ) ;
97
+ canvas . width = this . width ;
98
+ canvas . height = this . height ;
99
99
100
- var ctx = canvas . getContext ( '2d' ) ;
101
- ctx . drawImage ( this , 0 , 0 ) ;
100
+ var ctx = canvas . getContext ( '2d' ) ;
101
+ ctx . drawImage ( this , 0 , 0 ) ;
102
102
103
- var dataURL = canvas . toDataURL ( 'image/png' ) ;
103
+ var dataURL = canvas . toDataURL ( 'image/png' ) ;
104
104
105
- thisImage . attr ( 'xlink:href' , dataURL ) ;
105
+ thisImage . attr ( 'xlink:href' , dataURL ) ;
106
106
107
- // resolve promise in onload handler instead of on 'load' to support IE11
108
- // see https://github.com/plotly/plotly.js/issues/1685
109
- // for more details
110
- resolve ( ) ;
111
- } ;
107
+ // resolve promise in onload handler instead of on 'load' to support IE11
108
+ // see https://github.com/plotly/plotly.js/issues/1685
109
+ // for more details
110
+ resolve ( ) ;
111
+ } ;
112
112
113
113
114
- thisImage . on ( 'error' , errorHandler ) ;
114
+ thisImage . on ( 'error' , errorHandler ) ;
115
115
116
- img . src = d . source ;
116
+ img . src = d . source ;
117
117
}
118
118
119
119
function errorHandler ( ) {
0 commit comments