Commit 9b376638 authored by 张博's avatar 张博

feat(release): fix movetoparent command reverse bug, release v1.4.34

parent 9a36e1c4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "kityminder-core", "name": "kityminder-core",
"title": "Kity Minder Core", "title": "Kity Minder Core",
"description": "Powerful online mind graphic visualization and editor (command based)", "description": "Powerful online mind graphic visualization and editor (command based)",
"version": "1.4.33", "version": "1.4.34",
"main": [ "main": [
"dist/kityminder.core.min.js", "dist/kityminder.core.min.js",
"dist/kityminder.core.css" "dist/kityminder.core.css"
......
/*! /*!
* ==================================================== * ====================================================
* kityminder - v1.4.33 - 2016-03-19 * kityminder - v1.4.34 - 2016-09-06
* https://github.com/fex-team/kityminder-core * https://github.com/fex-team/kityminder-core
* GitHub: https://github.com/fex-team/kityminder-core.git * GitHub: https://github.com/fex-team/kityminder-core.git
* Copyright (c) 2016 Baidu FEX; Licensed MIT * Copyright (c) 2016 Baidu FEX; Licensed MIT
...@@ -4714,7 +4714,7 @@ _p[45] = { ...@@ -4714,7 +4714,7 @@ _p[45] = {
base: Command, base: Command,
execute: function(minder, nodes, parent) { execute: function(minder, nodes, parent) {
var node; var node;
for (var i = nodes.length - 1; i >= 0; i--) { for (var i = 0; i < nodes.length; i++) {
node = nodes[i]; node = nodes[i];
if (node.parent) { if (node.parent) {
node.parent.removeChild(node); node.parent.removeChild(node);
...@@ -8103,7 +8103,7 @@ _p[65] = { ...@@ -8103,7 +8103,7 @@ _p[65] = {
imagesInfo: imagesInfo imagesInfo: imagesInfo
}; };
} }
function encode(json, minder) { function encode(json, minder, option) {
var resultCallback; var resultCallback;
var Promise = kityminder.Promise; var Promise = kityminder.Promise;
/* 绘制 PNG 的画布及上下文 */ /* 绘制 PNG 的画布及上下文 */
...@@ -8115,8 +8115,10 @@ _p[65] = { ...@@ -8115,8 +8115,10 @@ _p[65] = {
var bgColor = kity.Color.parse(bgDeclare); var bgColor = kity.Color.parse(bgDeclare);
/* 获取 SVG 文件内容 */ /* 获取 SVG 文件内容 */
var svgInfo = getSVGInfo(minder); var svgInfo = getSVGInfo(minder);
var width = svgInfo.width; var width = option.width && option.width > svgInfo.width ? option.width : svgInfo.width;
var height = svgInfo.height; var height = 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 offsetY = 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;
/* 画布的填充大小 */ /* 画布的填充大小 */
...@@ -8151,7 +8153,7 @@ _p[65] = { ...@@ -8151,7 +8153,7 @@ _p[65] = {
url: svgDataUrl url: svgDataUrl
}; };
return loadImage(svgData).then(function($image) { return loadImage(svgData).then(function($image) {
drawImage(ctx, $image.element, padding, padding); drawImage(ctx, $image.element, offsetX, offsetY, $image.width, $image.height);
return loadImages(imagesInfo); return loadImages(imagesInfo);
}).then(function($images) { }).then(function($images) {
for (var i = 0; i < $images.length; i++) { for (var i = 0; i < $images.length; i++) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "kityminder", "name": "kityminder",
"title": "kityminder", "title": "kityminder",
"description": "KityMinder Core Implement", "description": "KityMinder Core Implement",
"version": "1.4.33", "version": "1.4.34",
"homepage": "https://github.com/fex-team/kityminder-core", "homepage": "https://github.com/fex-team/kityminder-core",
"author": { "author": {
"name": "Baidu FEX", "name": "Baidu FEX",
......
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