File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -585,9 +585,18 @@ var p5DOM = (function(){
585585 }
586586 // set diff for cnv vs normal div
587587 if ( this . elt instanceof HTMLCanvasElement ) {
588+ var j = { } ;
589+ var k = this . elt . getContext ( '2d' ) ;
590+ for ( var prop in k ) {
591+ j [ prop ] = k [ prop ] ;
592+ }
588593 this . elt . setAttribute ( 'width' , aW * this . _pInst . _pixelDensity ) ;
589594 this . elt . setAttribute ( 'height' , aH * this . _pInst . _pixelDensity ) ;
590595 this . elt . setAttribute ( 'style' , 'width:' + aW + 'px !important; height:' + aH + 'px !important;' ) ;
596+ this . _pInst . scale ( this . _pInst . _pixelDensity , this . _pInst . _pixelDensity ) ;
597+ for ( var prop in j ) {
598+ this . elt . getContext ( '2d' ) [ prop ] = j [ prop ] ;
599+ }
591600 } else {
592601 this . elt . style . width = aW + 'px' ;
593602 this . elt . style . height = aH + 'px' ;
You can’t perform that action at this time.
0 commit comments