@@ -8267,8 +8267,10 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
82678267 this . node = document . createElement ( "div" ) ;
82688268 if ( image . src != null ) {
82698269 this . node . style . background = "url(" + image . src + ") transparent" ;
8270- } else {
8270+ } else if ( typeof document . getCSSCanvasContext !== "undefined" ) {
82718271 this . node . style . background = "-webkit-canvas(" + image . name + ") transparent" ;
8272+ } else {
8273+ this . node . style . background = "url(" + ( image . toDataURL ( 'image/png' ) ) + ") transparent" ;
82728274 }
82738275 this . node . style . backgroundPosition = "" + ( - su ) + "px " + ( - sv ) + "px" ;
82748276 this . node . style . width = "" + sw + "px" ;
@@ -8432,6 +8434,7 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
84328434 this . textRendered = false ;
84338435 this . textScale = this . lwf . textScale ;
84348436 this . currentShadowMarginY = 0 ;
8437+ this . changed = false ;
84358438 this . initCanvas ( ) ;
84368439 }
84378440
@@ -8704,8 +8707,10 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
87048707 this . initCanvas ( ) ;
87058708 this . textScale = this . lwf . textScale ;
87068709 }
8710+ this . changed = false ;
87078711 if ( ! this . textRendered || colorChanged || fontChanged || strChanged || scaleChanged ) {
87088712 this . renderText ( c ) ;
8713+ this . changed = true ;
87098714 }
87108715 } ;
87118716
@@ -8855,9 +8860,12 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
88558860 this . context . factory . stage . appendChild ( this . node ) ;
88568861 nodeChanged = true ;
88578862 }
8858- if ( this . currentCanvas !== this . canvas ) {
8863+ if ( typeof document . getCSSCanvasContext !== 'undefined' && this . currentCanvas !== this . canvas ) {
88598864 this . node . style . background = "-webkit-canvas(" + this . canvas . name + ") transparent" ;
88608865 this . currentCanvas = this . canvas ;
8866+ } else if ( this . changed || this . currentCanvas !== this . canvas ) {
8867+ this . node . style . background = "url(" + ( this . canvas . toDataURL ( 'image/png' ) ) + ") transparent" ;
8868+ this . currentCanvas = this . canvas ;
88618869 }
88628870 maskMode = this . context . factory . maskMode ;
88638871 if ( ! nodeChanged && ! this . matrixChanged && this . alpha === c . multi . alpha && this . zIndex === renderingIndex && maskMode === "normal" && this . node . parentNode === this . context . factory . stage ) {
@@ -9563,7 +9571,7 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
95639571 WebkitCSSResourceCache . prototype . createCanvas = function ( w , h ) {
95649572 var canvas , ctx , name ;
95659573 name = this . getCanvasName ( ) ;
9566- if ( this . constructor === WebkitCSSResourceCache ) {
9574+ if ( typeof document . getCSSCanvasContext !== 'undefined' && this . constructor === WebkitCSSResourceCache ) {
95679575 ctx = document . getCSSCanvasContext ( "2d" , name , w , h ) ;
95689576 canvas = ctx . canvas ;
95699577 } else {
0 commit comments