Commit 5e60e28a authored by campaign's avatar campaign

修复光标

parent da286ad2
......@@ -45,7 +45,8 @@ Minder.Selection = kity.createClass( 'Selection', {
if(i === 0 || cIndex === startOffset){
tmpOffset.x = o.x;
tmpOffset.y = o.y;
tmpOffset.width = i === 0 && offset && offset.x <= o.x && cIndex != startOffset ? 0 : o.width;
tmpOffset.width = o.width;
//i === 0 && offset && offset.x <= o.x && cIndex != startOffset ? 0 :
}else if(cIndex < endOffset){
tmpOffset.width += o.width;
}else if(cIndex === endOffset){
......@@ -54,7 +55,6 @@ Minder.Selection = kity.createClass( 'Selection', {
}
cIndex++;
});
if(tmpOffset.x !== undefined) {
arrOffset.push(tmpOffset);
......
......@@ -38,15 +38,18 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
this.setTextStyle(node, textGroup);
for (var i = 0, text, textShape;
(text = textArr[i], textShape = textGroup.getItem(i),
text !== undefined || textShape !== undefined); i++) {
var textLength = textArr.length;
var textGroupLength = textGroup.getItems().length;
if (text === undefined && textShape) {
if(textLength < textGroupLength){
for( var i = textLength,ci;ci = textGroup.getItem(i);){
textGroup.removeItem(i);
} else {
if (text !== undefined && !textShape) {
textShape = new kity.Text()
}
}else if(textLength > textGroupLength){
var length = textLength - textGroupLength;
for(var i = 0;i < length;i++){
var textShape = new kity.Text()
.setAttr('text-rendering', 'inherit');
if (kity.Browser.ie) {
textShape.setVerticalAlign('top');
......@@ -55,12 +58,14 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
}
textGroup.addItem(textShape);
}
textShape.setContent(text);
}
for (var i = 0, text, textShape;
(text = textArr[i], textShape = textGroup.getItem(i)); i++) {
textShape.setContent(text);
}
}
this.setTextStyle(node, textGroup);
return function() {
......
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