@@ -463,15 +463,6 @@ RenderImage.prototype.setAttr = function RIsetAttr(attr, value) {
463463 if ( self . image . src !== value ) {
464464 self . image . src = value ;
465465 }
466- } else if (
467- value instanceof HTMLImageElement ||
468- value instanceof SVGImageElement ||
469- value instanceof HTMLCanvasElement
470- ) {
471- self . imageObj = value ;
472- // self.postProcess();
473- self . attr . height = self . attr . height ? self . attr . height : value . height ;
474- self . attr . width = self . attr . width ? self . attr . width : value . width ;
475466 } else if ( value instanceof CanvasNodeExe || value instanceof RenderTexture ) {
476467 self . imageObj = value . domEl ;
477468 // self.postProcess();
@@ -1802,11 +1793,11 @@ function GetCanvasImgInstance(width, height) {
18021793}
18031794
18041795GetCanvasImgInstance . prototype . setAttr = function ( attr , value ) {
1805- if ( attr === "height" ) {
1806- this . canvas . setAttribute ( "height" , value ) ;
1807- } else if ( attr === "width" ) {
1808- this . canvas . setAttribute ( "width" , value ) ;
1809- }
1796+ // if (attr === "height") {
1797+ // this.canvas.setAttribute("height", value);
1798+ // } else if (attr === "width") {
1799+ // this.canvas.setAttribute("width", value);
1800+ // }
18101801} ;
18111802
18121803function textureImageInstance ( self , url ) {
@@ -1904,7 +1895,8 @@ function RenderTexture(nodeExe, config = {}) {
19041895 self . nodeExe = nodeExe ;
19051896
19061897 for ( const key in self . attr ) {
1907- self . setAttr ( key , self . attr [ key ] ) ;
1898+ if ( key !== "height" && key !== "width" )
1899+ self . setAttr ( key , self . attr [ key ] ) ;
19081900 }
19091901
19101902 queueInstance . vDomChanged ( nodeExe . vDomIndex ) ;
@@ -1955,15 +1947,6 @@ RenderTexture.prototype.setAttr = function RSsetAttr(attr, value) {
19551947 if ( self . image . src !== value ) {
19561948 self . image . src = value ;
19571949 }
1958- } else if (
1959- value instanceof HTMLImageElement ||
1960- value instanceof SVGImageElement ||
1961- value instanceof HTMLCanvasElement
1962- ) {
1963- self . imageObj = value ;
1964- self . attr . height = self . attr . height ? self . attr . height : value . height ;
1965- self . attr . width = self . attr . width ? self . attr . width : value . width ;
1966- postProcess ( self ) ;
19671950 } else if ( value instanceof CanvasNodeExe || value instanceof RenderTexture ) {
19681951 self . imageObj = value . domEl ;
19691952 self . attr . height = self . attr . height ? self . attr . height : value . attr . height ;
@@ -2081,7 +2064,7 @@ function createPage (ctx) {
20812064 root . setSize = function ( width_ , height_ ) {
20822065 // width = width_;
20832066 // height = height_;
2084- this . domEl = new Canvas ( width_ , height_ , "pdf" ) ;
2067+ this . domEl = createCanvas ( width_ , height_ , "pdf" ) ;
20852068 ctx = this . domEl . getContext ( "2d" , config ) ;
20862069 ctx . type_ = "pdf" ;
20872070 this . width = width_ ;
@@ -2206,6 +2189,17 @@ function pdfLayer(config, height = 0, width = 0) {
22062189
22072190 return this . domEl . toBuffer ( 'application/pdf' , metaData ) ;
22082191 }
2192+ PDFCreator . prototype . exec = function ( exe ) {
2193+ exe . call ( this , this . dataObj ) ;
2194+ }
2195+ PDFCreator . prototype . data = function ( data ) {
2196+ if ( ! data ) {
2197+ return this . dataObj ;
2198+ } else {
2199+ this . dataObj = data ;
2200+ }
2201+ return this ;
2202+ }
22092203
22102204 return new PDFCreator ( ctx ) ;
22112205}
0 commit comments