@@ -668,7 +668,7 @@ acgraph.vector.normalizeFill = function(opt_fillOrColorOrKeys, opt_opacityOrAngl
668668 } ;
669669 }
670670 } else if ( goog . isObject ( opt_fillOrColorOrKeys ) ) { // fill as an object
671- if ( opt_fillOrColorOrKeys instanceof acgraph . vector . PatternFill ) {
671+ if ( acgraph . utils . instanceOf ( opt_fillOrColorOrKeys , acgraph . vector . PatternFill ) ) {
672672 newFill = opt_fillOrColorOrKeys ;
673673 } else if ( opt_fillOrColorOrKeys [ 'type' ] == 'pattern' ) {
674674 delete opt_fillOrColorOrKeys [ 'id' ] ;
@@ -753,7 +753,7 @@ acgraph.vector.normalizeFill = function(opt_fillOrColorOrKeys, opt_opacityOrAngl
753753 }
754754 var transform = opt_fillOrColorOrKeys [ 'transform' ] ;
755755 if ( goog . isDefAndNotNull ( transform ) ) {
756- if ( transform instanceof goog . math . AffineTransform ) {
756+ if ( acgraph . utils . instanceOf ( transform , goog . math . AffineTransform ) ) {
757757 newFill [ 'transform' ] = transform ;
758758 } else if ( goog . isObject ( transform ) ) {
759759 newFill [ 'transform' ] = new goog . math . AffineTransform ( ) ;
@@ -839,7 +839,7 @@ acgraph.vector.normalizeStroke = function(opt_strokeOrFill, opt_thickness, opt_d
839839 // No pattern fill for stroke, unfortunately :D
840840 // Double typecast should be here, via ColoredFill,
841841 // but that's too much metadata, so let's go with this.
842- newStroke = ( tmp instanceof acgraph . vector . PatternFill ) ? 'black' : /** @type {acgraph.vector.Stroke } */ ( tmp ) ;
842+ newStroke = ( acgraph . utils . instanceOf ( tmp , acgraph . vector . PatternFill ) ) ? 'black' : /** @type {acgraph.vector.Stroke } */ ( tmp ) ;
843843
844844 // If nothing else we can use normalized fill as a stroke,
845845 // ot is compatible. Otherwise we need to add properties.
@@ -891,7 +891,7 @@ acgraph.vector.normalizeHatchFill = function(opt_patternFillOrType, opt_color, o
891891 opt_color ,
892892 goog . isDef ( opt_thickness ) ? parseFloat ( opt_thickness ) : undefined ,
893893 goog . isDef ( opt_size ) ? parseFloat ( opt_size ) : undefined ) ;
894- } else if ( opt_patternFillOrType instanceof acgraph . vector . PatternFill ) {
894+ } else if ( acgraph . utils . instanceOf ( opt_patternFillOrType , acgraph . vector . PatternFill ) ) {
895895 newFill = opt_patternFillOrType ;
896896 } else if ( goog . isObject ( opt_patternFillOrType ) ) {
897897 if ( opt_patternFillOrType [ 'type' ] == 'pattern' ) {
@@ -909,7 +909,7 @@ acgraph.vector.normalizeHatchFill = function(opt_patternFillOrType, opt_color, o
909909 }
910910 } else
911911 newFill = null ;
912- return newFill ;
912+ return /** @type { acgraph.vector.PatternFill|acgraph.vector.HatchFill } */ ( newFill ) ;
913913} ;
914914
915915
@@ -967,8 +967,8 @@ acgraph.vector.normalizePageSize = function(opt_paperSizeOrWidth, opt_landscapeO
967967 */
968968acgraph . vector . normalizeGradientMode = function ( mode ) {
969969 if ( goog . isDefAndNotNull ( mode ) ) { // mode is set
970- if ( mode instanceof goog . math . Rect )
971- return mode ;
970+ if ( acgraph . utils . instanceOf ( mode , goog . math . Rect ) )
971+ return /** @type { goog.math.Rect } */ ( mode ) ;
972972 else if ( goog . isObject ( mode ) && ! isNaN ( mode [ 'left' ] ) && ! isNaN ( mode [ 'top' ] ) && ! isNaN ( mode [ 'width' ] ) && ! isNaN ( mode [ 'height' ] ) )
973973 return new goog . math . Rect ( mode [ 'left' ] , mode [ 'top' ] , mode [ 'width' ] , mode [ 'height' ] ) ;
974974 }
0 commit comments