Commit 3001e7f0 authored by 张博's avatar 张博

fixed bug of tianpan outline box

parent 79d34031
......@@ -41,15 +41,15 @@ define(function(require, exports, module) {
var radius = node.getStyle('radius');
// 天盘图圆形的情况
if (shape && shape == 'circle') {
var width= Math.max(box.width,box.height);
outlineBox.width = width + paddingLeft + paddingRight;
outlineBox.height = width + paddingTop + paddingBottom;
var p = Math.pow;
var r = Math.round;
outlineBox.width = Math.max(outlineBox.width, outlineBox.height);
outlineBox.height = Math.max(outlineBox.width, outlineBox.height);
radius = r(Math.sqrt(p(outlineBox.width, 2) + p(outlineBox.height, 2)) / 2);
radius = outlineBox.width / 2;
outlineBox.x = box.cx - radius;
outlineBox.y = box.cy - radius;
outlineBox.width = 2 * radius;
outlineBox.height = 2 * radius;
}
var prefix = node.isSelected() ? (node.getMinder().isFocused() ? 'selected-' : 'blur-selected-') : '';
......
......@@ -226,13 +226,7 @@ define(function(require, exports, module) {
rBox = rBox.merge(new kity.Box(0, y, bbox.height && bbox.width || 1, fontSize));
});
//为了让文字在圆中垂直居中
var w = 0;
var shape = node.getStyle('shape');
if (shape && shape == 'circle'){
w = Math.max(rBox.width, rBox.height) / 2 - rBox.height / 2;
}
var nBox = new kity.Box(r(rBox.x), r(rBox.y - w), r(rBox.width), r(rBox.height));
var nBox = new kity.Box(r(rBox.x), r(rBox.y), r(rBox.width), r(rBox.height));
node._currentTextGroupBox = nBox;
return nBox;
......
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