@@ -1082,18 +1082,24 @@ acgraph.vector.svg.Renderer.prototype.applyFill = function(element) {
10821082 var defs = element . getStage ( ) . getDefs ( ) ;
10831083 var pathPrefix = 'url(' + acgraph . getReference ( ) + '#' ;
10841084
1085+ // DVF-1729 fix
1086+ // because internet explorer converts fill-opacity "0.00001" to "1e-5" that is not css-compatible
1087+ // and export server can't generate proper image.
1088+ if ( fill && fill [ 'opacity' ] && fill [ 'opacity' ] <= 0.0001 && goog . userAgent . IE && goog . userAgent . isVersionOrHigher ( '9' ) )
1089+ fill [ 'opacity' ] = 0.0001 ;
1090+
10851091 if ( goog . isString ( fill ) ) {
10861092 this . setAttr ( element . domElement ( ) , 'fill' , /** @type {string } */ ( fill ) ) ;
10871093 this . removeAttr ( element . domElement ( ) , 'fill-opacity' ) ;
10881094 } else if ( goog . isArray ( fill [ 'keys' ] ) && fill [ 'cx' ] && fill [ 'cy' ] ) {
10891095 this . setAttr ( element . domElement ( ) , 'fill' , pathPrefix +
10901096 this . renderRadialGradient ( /** @type {acgraph.vector.RadialGradientFill } */ ( fill ) , defs ) + ')' ) ;
1091- this . removeAttr ( element . domElement ( ) , 'fill-opacity' ) ;
1097+ this . setAttr ( element . domElement ( ) , 'fill-opacity' , goog . isDef ( fill [ 'opacity' ] ) ? fill [ 'opacity' ] : 1 ) ;
10921098 } else if ( goog . isArray ( fill [ 'keys' ] ) ) {
10931099 if ( ! element . getBounds ( ) ) return ;
10941100 this . setAttr ( element . domElement ( ) , 'fill' ,
10951101 pathPrefix + this . renderLinearGradient ( /** @type {acgraph.vector.LinearGradientFill } */ ( fill ) , defs , element . getBounds ( ) ) + ')' ) ;
1096- this . removeAttr ( element . domElement ( ) , 'fill-opacity' ) ;
1102+ this . setAttr ( element . domElement ( ) , 'fill-opacity' , goog . isDef ( fill [ 'opacity' ] ) ? fill [ 'opacity' ] : 1 ) ;
10971103 } else if ( fill [ 'src' ] ) {
10981104 var b = element . getBoundsWithoutTransform ( ) ;
10991105 if ( b ) {
@@ -1132,11 +1138,6 @@ acgraph.vector.svg.Renderer.prototype.applyFill = function(element) {
11321138 pattern . parent ( element . getStage ( ) ) . render ( ) ;
11331139 this . setAttr ( element . domElement ( ) , 'fill' , pathPrefix + pattern . id ( ) + ')' ) ;
11341140 } else {
1135- // DVF-1729 fix
1136- // because internet explorer converts fill-opacity "0.00001" to "1e-5" that is not css-compatible
1137- // and export server can't generate proper image.
1138- if ( fill [ 'opacity' ] <= 0.0001 && goog . userAgent . IE && goog . userAgent . isVersionOrHigher ( '9' ) )
1139- fill [ 'opacity' ] = 0.0001 ;
11401141 this . setAttrs ( element . domElement ( ) , {
11411142 'fill' : ( /** @type {acgraph.vector.SolidFill } */ ( fill ) ) [ 'color' ] ,
11421143 'fill-opacity' : ( /** @type {acgraph.vector.SolidFill } */ ( fill ) ) [ 'opacity' ]
0 commit comments