Commit e6b61326 authored by Bo Zhang's avatar Bo Zhang Committed by GitHub

Merge pull request #16 from citywill/patch-2

Update png.js
parents 89c16d02 fcc99c9a
...@@ -136,10 +136,10 @@ define(function(require, exports, module) { ...@@ -136,10 +136,10 @@ define(function(require, exports, module) {
/* 获取 SVG 文件内容 */ /* 获取 SVG 文件内容 */
var svgInfo = getSVGInfo(minder); var svgInfo = getSVGInfo(minder);
var width = option.width && option.width > svgInfo.width ? option.width : svgInfo.width; var width = option && option.width && option.width > svgInfo.width ? option.width : svgInfo.width;
var height = option.height && option.height > svgInfo.height ? option.height : svgInfo.height; var height = option && option.height && option.height > svgInfo.height ? option.height : svgInfo.height;
var offsetX = option.width && option.width > svgInfo.width ? (option.width - svgInfo.width)/2 : 0; var offsetX = option && option.width && option.width > svgInfo.width ? (option.width - svgInfo.width)/2 : 0;
var offsetY = option.height && option.height > svgInfo.height ? (option.height - svgInfo.height)/2 : 0; var offsetY = option && option.height && option.height > svgInfo.height ? (option.height - svgInfo.height)/2 : 0;
var svgDataUrl = svgInfo.dataUrl; var svgDataUrl = svgInfo.dataUrl;
var imagesInfo = svgInfo.imagesInfo; var imagesInfo = svgInfo.imagesInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment