Commit 37a5506d authored by techird's avatar techird

bug fix

parent 5cee1be9
......@@ -49,7 +49,7 @@ KityMinder.registerLayout('bottom', kity.createClass({
if (i > 0) {
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));
x += childTreeBox.width / 2 + children[i].getStyle('margin-right');
}
......
......@@ -228,9 +228,6 @@ KityMinder.registerModule('Expand', function() {
r.update(r.getRenderShape(), e.node);
}
},
'preimport': function(e) {
var json = e.json;
},
'beforerender': function(e) {
var node = e.node;
var visible = !node.parent || node.parent.isExpanded();
......
......@@ -24,8 +24,8 @@ KityMinder.registerModule('image', function() {
}
return {
width: width,
height: height
width: width | 0,
height: height | 0
};
}
......@@ -118,14 +118,17 @@ KityMinder.registerModule('image', function() {
if (!size) return;
var x = box.cx - size.width / 2;
var y = box.y - size.height - spaceTop;
image
.setUrl(url)
.setX(box.cx - size.width / 2)
.setY(box.y - size.height - spaceTop)
.setWidth(size.width)
.setHeight(size.height);
.setX(x | 0)
.setY(y | 0)
.setWidth(size.width | 0)
.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() {
rect = this.rect;
rect.setPosition(0, box.y - paddingY);
rect.setSize(
this.width = box.width + paddingX * 2,
this.height = box.height + paddingY * 2);
this.width = Math.round(box.width + paddingX * 2);
this.height = Math.round(box.height + paddingY * 2);
rect.setSize(this.width, this.height);
rect.fill(color);
}
});
......@@ -244,7 +244,7 @@ KityMinder.registerModule('Resource', function() {
}
overlay.setVisible(true);
overlay.setValue(resource[i], minder.getResourceColor(resource[i]));
overlay.setTranslate(x, 0);
overlay.setTranslate(x, -1);
x += overlay.width;
}
......@@ -255,7 +255,7 @@ KityMinder.registerModule('Resource', function() {
return {
x: box.right,
y: -overlays[0].height / 2,
y: Math.round(-overlays[0].height / 2),
width: x,
height: overlays[0].height
};
......
......@@ -3,7 +3,7 @@ KityMinder.registerModule('Zoom', function() {
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) {
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