@@ -2352,17 +2352,12 @@ function exec(value) {
23522352 return this ;
23532353}
23542354
2355- function on ( eventType , hndlr ) {
2356- for ( var i = 0 , len = this . stack . length ; i < len ; i += 1 ) {
2357- this . stack [ i ] . on ( eventType , hndlr ) ;
2358- }
2355+ // function on(eventType, hndlr) {
2356+ // for (let i = 0, len = this.stack.length; i < len; i += 1) {
2357+ // this.stack[i].on(eventType, hndlr);
2358+ // }
23592359
2360- return this ;
2361- } // function in (coOr) {
2362- // for (let i = 0, len = this.stack.length; i < len; i += 1) {
2363- // this.stack[i].in(coOr)
2364- // }
2365- // return this
2360+ // return this;
23662361// }
23672362
23682363function remove ( ) {
@@ -2373,13 +2368,30 @@ function remove() {
23732368 return this ;
23742369}
23752370
2376- function interrupt ( ) {
2377- for ( var i = 0 , len = this . stack . length ; i < len ; i += 1 ) {
2378- this . stack [ i ] . interrupt ( ) ;
2379- }
2371+ // function interrupt() {
2372+ // for (let i = 0, len = this.stack.length; i < len; i += 1) {
2373+ // this.stack[i].interrupt();
2374+ // }
23802375
2381- return this ;
2382- }
2376+ // return this;
2377+ // }
2378+
2379+ // function resolveObject(config, node, i) {
2380+ // const obj = {};
2381+ // let key;
2382+
2383+ // for (key in config) {
2384+ // if (key !== "end") {
2385+ // if (typeof config[key] === "function") {
2386+ // obj[key] = config[key].call(node, node.dataObj, i);
2387+ // } else {
2388+ // obj[key] = config[key];
2389+ // }
2390+ // }
2391+ // }
2392+
2393+ // return obj;
2394+ // }
23832395
23842396var textArray = function textArray ( value ) {
23852397 var node ;
@@ -2476,14 +2488,9 @@ CollectionPrototype.prototype = {
24762488 rotate : rotate ,
24772489 scale : scale ,
24782490 exec : exec ,
2479- // animateTo: animateArrayTo,
2480- // animateExe: animateArrayExe,
2481- // animatePathTo: animatePathArrayTo,
24822491 remove : remove ,
2483- interrupt : interrupt ,
24842492 text : textArray ,
24852493 join : join ,
2486- on : on ,
24872494} ;
24882495
24892496CollectionPrototype . prototype . createNode = function ( ) { } ;
@@ -2739,8 +2746,6 @@ function PixelObject(data, width, height) {
27392746 this . imageData = data ;
27402747 this . width = width ;
27412748 this . height = height ;
2742- // this.x = x;
2743- // this.y = y;
27442749}
27452750
27462751PixelObject . prototype . get = function ( pos ) {
@@ -2896,7 +2901,6 @@ function CanvasDom() {
28962901
28972902CanvasDom . prototype = {
28982903 render : cRender ,
2899- // on: addListener,
29002904 setAttr : domSetAttribute ,
29012905 setStyle : domSetStyle ,
29022906 applyStyles : applyStyles ,
@@ -2906,15 +2910,12 @@ function imageInstance(self) {
29062910 var imageIns = new Image ( ) ;
29072911 imageIns . crossOrigin = "anonymous" ;
29082912 imageIns . dataMode = Image . MODE_MIME | Image . MODE_IMAGE ;
2909- // console.log(self.ctx.type_);
29102913 imageIns . onload = function onload ( ) {
29112914 self . attr . height = self . attr . height ? self . attr . height : imageIns . naturalHeight ;
29122915 self . attr . width = self . attr . width ? self . attr . width : imageIns . naturalWidth ;
29132916 self . imageObj = imageIns ;
29142917
29152918 if ( self . nodeExe . attr . onload && typeof self . nodeExe . attr . onload === "function" ) {
2916- // console.log(self);
2917- // console.log(self.nodeExe);
29182919 self . nodeExe . attr . onload . call ( self . nodeExe , self . image ) ;
29192920 }
29202921
@@ -3058,7 +3059,9 @@ RenderText.prototype.fitWidth = function () {
30583059 if ( this . ctx . measureText ( strLit + textList [ i ] ) . width < width ) {
30593060 strLit = strLit + textList [ i ] ;
30603061 } else {
3061- textSubStrs . push ( strLit ) ;
3062+ if ( strLit && strLit . length > 0 ) {
3063+ textSubStrs . push ( strLit ) ;
3064+ }
30623065 strLit = textList [ i ] ;
30633066 }
30643067 }
@@ -3415,14 +3418,6 @@ RenderPath.prototype.updateBBox = function RPupdateBBox() {
34153418 var scaleX = ref$1 . scaleX ;
34163419 var scaleY = ref$1 . scaleY ;
34173420
3418- // if (transform && transform.translate) {
3419- // [translateX, translateY] = transform.translate;
3420- // }
3421-
3422- // if (transform && transform.scale) {
3423- // [scaleX = 1, scaleY = scaleX] = transform.scale;
3424- // }
3425-
34263421 self . BBox = self . path
34273422 ? self . path . BBox
34283423 : {
@@ -3623,10 +3618,6 @@ RenderEllipse.prototype.constructor = RenderEllipse;
36233618
36243619RenderEllipse . prototype . updateBBox = function REupdateBBox ( ) {
36253620 var self = this ;
3626- // let translateX = 0;
3627- // let translateY = 0;
3628- // let scaleX = 1;
3629- // let scaleY = 1;
36303621 var ref = self . attr ;
36313622 var transform = ref . transform ;
36323623 var cx = ref . cx ; if ( cx === void 0 ) cx = 0 ;
@@ -3639,14 +3630,6 @@ RenderEllipse.prototype.updateBBox = function REupdateBBox() {
36393630 var scaleX = ref$1 . scaleX ;
36403631 var scaleY = ref$1 . scaleY ;
36413632
3642- // if (transform && transform.translate) {
3643- // [translateX, translateY] = transform.translate;
3644- // }
3645-
3646- // if (transform && transform.scale) {
3647- // [scaleX = 1, scaleY = scaleX] = transform.scale;
3648- // }
3649-
36503633 self . BBox = {
36513634 x : translateX + ( cx - rx ) * scaleX ,
36523635 y : translateY + ( cy - ry ) * scaleY ,
@@ -4002,13 +3985,6 @@ var CanvasNodeExe = function CanvasNodeExe(context, config, id, vDomIndex) {
40023985
40033986 this . dom . nodeExe = this ;
40043987 this . BBoxUpdate = true ;
4005- // if (config.style) {
4006- // this.setStyle(config.style);
4007- // }
4008-
4009- // if (config.attr) {
4010- // this.setAttr(config.attr);
4011- // }
40123988} ;
40133989
40143990CanvasNodeExe . prototype = new NodePrototype ( ) ;
@@ -4202,7 +4178,7 @@ CanvasNodeExe.prototype.execute = function Cexecute(disableRestore) {
42024178 if ( this . style . display === "none" ) {
42034179 return ;
42044180 }
4205- console . log ( disableRestore ) ;
4181+ // console.log(disableRestore);
42064182 if ( ! disableRestore ) {
42074183 this . ctx . save ( ) ;
42084184 }
@@ -4493,8 +4469,6 @@ function RenderTexture(nodeExe, config) {
44934469 if ( key !== "height" && key !== "width" )
44944470 { self . setAttr ( key , self . attr [ key ] ) ; }
44954471 }
4496-
4497- // self.stack = [self];
44984472}
44994473RenderTexture . prototype = new NodePrototype ( ) ;
45004474RenderTexture . prototype . constructor = RenderTexture ;
@@ -4619,9 +4593,8 @@ function createPage (ctx) {
46194593 ) ;
46204594 root . ENV = "NODE" ;
46214595 var execute = root . execute . bind ( root ) ;
4622- var ratio = 1 ;
46234596 var onClear = function ( ctx , width , height ) {
4624- ctx . clearRect ( 0 , 0 , width * ratio , height * ratio ) ;
4597+ ctx . clearRect ( 0 , 0 , width , height ) ;
46254598 } ;
46264599
46274600 root . setClear = function ( exe ) {
@@ -4658,8 +4631,6 @@ function createPage (ctx) {
46584631 } ;
46594632
46604633 root . setSize = function ( width_ , height_ ) {
4661- // width = width_;
4662- // height = height_;
46634634 this . domEl = createCanvas ( width_ , height_ , "pdf" ) ;
46644635 ctx = this . domEl . getContext ( "2d" , config ) ;
46654636 ctx . type_ = "pdf" ;
@@ -4671,7 +4642,7 @@ function createPage (ctx) {
46714642
46724643 root . execute = function executeExe ( ) {
46734644 onClear ( ctx , this . width , this . height ) ;
4674- ctx . setTransform ( ratio , 0 , 0 , ratio , 0 , 0 ) ;
4645+ ctx . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) ;
46754646 this . updateBBox ( ) ;
46764647 execute ( ) ;
46774648 if ( onChangeExe && this . stateModified ) {
0 commit comments