Commit 37a5506d authored by techird's avatar techird

bug fix

parent 5cee1be9
...@@ -49,7 +49,7 @@ KityMinder.registerLayout('bottom', kity.createClass({ ...@@ -49,7 +49,7 @@ KityMinder.registerLayout('bottom', kity.createClass({
if (i > 0) { if (i > 0) {
x += children[i].getStyle('margin-left'); x += children[i].getStyle('margin-left');
} }
y = nodeContentBox.height + node.getStyle('margin-bottom') + children[i].getStyle('margin-top'); y = nodeContentBox.bottom - childContentBox.top + node.getStyle('margin-bottom') + child.getStyle('margin-top');
children[i].setLayoutTransform(new kity.Matrix().translate(x, y)); children[i].setLayoutTransform(new kity.Matrix().translate(x, y));
x += childTreeBox.width / 2 + children[i].getStyle('margin-right'); x += childTreeBox.width / 2 + children[i].getStyle('margin-right');
} }
......
...@@ -228,9 +228,6 @@ KityMinder.registerModule('Expand', function() { ...@@ -228,9 +228,6 @@ KityMinder.registerModule('Expand', function() {
r.update(r.getRenderShape(), e.node); r.update(r.getRenderShape(), e.node);
} }
}, },
'preimport': function(e) {
var json = e.json;
},
'beforerender': function(e) { 'beforerender': function(e) {
var node = e.node; var node = e.node;
var visible = !node.parent || node.parent.isExpanded(); var visible = !node.parent || node.parent.isExpanded();
......
...@@ -24,8 +24,8 @@ KityMinder.registerModule('image', function() { ...@@ -24,8 +24,8 @@ KityMinder.registerModule('image', function() {
} }
return { return {
width: width, width: width | 0,
height: height height: height | 0
}; };
} }
...@@ -118,14 +118,17 @@ KityMinder.registerModule('image', function() { ...@@ -118,14 +118,17 @@ KityMinder.registerModule('image', function() {
if (!size) return; if (!size) return;
var x = box.cx - size.width / 2;
var y = box.y - size.height - spaceTop;
image image
.setUrl(url) .setUrl(url)
.setX(box.cx - size.width / 2) .setX(x | 0)
.setY(box.y - size.height - spaceTop) .setY(y | 0)
.setWidth(size.width) .setWidth(size.width | 0)
.setHeight(size.height); .setHeight(size.height | 0);
return new kity.Box(image.getX(), image.getY(), size.width, size.height); return new kity.Box(x | 0, y | 0, size.width | 0, size.height | 0);
} }
}); });
......
...@@ -202,9 +202,9 @@ KityMinder.registerModule('Resource', function() { ...@@ -202,9 +202,9 @@ KityMinder.registerModule('Resource', function() {
rect = this.rect; rect = this.rect;
rect.setPosition(0, box.y - paddingY); rect.setPosition(0, box.y - paddingY);
rect.setSize( this.width = Math.round(box.width + paddingX * 2);
this.width = box.width + paddingX * 2, this.height = Math.round(box.height + paddingY * 2);
this.height = box.height + paddingY * 2); rect.setSize(this.width, this.height);
rect.fill(color); rect.fill(color);
} }
}); });
...@@ -244,7 +244,7 @@ KityMinder.registerModule('Resource', function() { ...@@ -244,7 +244,7 @@ KityMinder.registerModule('Resource', function() {
} }
overlay.setVisible(true); overlay.setVisible(true);
overlay.setValue(resource[i], minder.getResourceColor(resource[i])); overlay.setValue(resource[i], minder.getResourceColor(resource[i]));
overlay.setTranslate(x, 0); overlay.setTranslate(x, -1);
x += overlay.width; x += overlay.width;
} }
...@@ -255,7 +255,7 @@ KityMinder.registerModule('Resource', function() { ...@@ -255,7 +255,7 @@ KityMinder.registerModule('Resource', function() {
return { return {
x: box.right, x: box.right,
y: -overlays[0].height / 2, y: Math.round(-overlays[0].height / 2),
width: x, width: x,
height: overlays[0].height height: overlays[0].height
}; };
......
...@@ -3,7 +3,7 @@ KityMinder.registerModule('Zoom', function() { ...@@ -3,7 +3,7 @@ KityMinder.registerModule('Zoom', function() {
var timeline; var timeline;
me.setDefaultOptions('zoom', [50, 80, 100, 120, 150, 200]); me.setDefaultOptions('zoom', [10, 20, 30, 50, 80, 100, 120, 150, 200]);
function fixPaperCTM(paper) { function fixPaperCTM(paper) {
var node = paper.shapeNode; var node = paper.shapeNode;
......
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