diff --git a/assets/index.js b/assets/index.js index 766b68d..e3af7a0 100644 --- a/assets/index.js +++ b/assets/index.js @@ -288,7 +288,7 @@ I18N['zh-cn'] = { $('#screen').css({ width: this.zoomSize( this.current.width ), height: this.zoomSize( this.current.height ), - background: '#FFF url(' + imageData + ') no-repeat', + background: '#FFF url("' + imageData + '") no-repeat', backgroundSize: this.zoomSize( this.current.width ) + 'px ' + this.zoomSize( this.current.height ) + 'px' }); @@ -1469,4 +1469,4 @@ I18N['zh-cn'] = { }; init.prototype = SMApp.fn; window.SMApp = SMApp; -})(window); \ No newline at end of file +})(window); diff --git a/src/parseText.v50.js b/src/parseText.v50.js index 8b04f00..6701d59 100644 --- a/src/parseText.v50.js +++ b/src/parseText.v50.js @@ -16,11 +16,22 @@ class TextStyle { constructor (layer) { this.layer = layer this.textStyle = layer.style.textStyle + if (this.textStyle==undefined){ + //console.log(layer) + return + } + if ( layer.style.textStyle.encodedAttributes == undefined){ + this.encodeAttr ={} + }else{ + this.encodeAttr = layer.style.textStyle.encodedAttributes + } +} - this.encodeAttr = layer.style.textStyle.encodedAttributes - } _getStyle () { + if (this.textStyle==undefined){ + return {} + } const fontSize = this.encodeAttr.MSAttributedStringFontAttribute.attributes.size const fontFace = this.encodeAttr.MSAttributedStringFontAttribute.attributes.name const paragraphStyle = this.encodeAttr.paragraphStyle || {}