mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-09 22:34:43 +00:00
fix insertCharStyleObject so that it deletes properly
This commit is contained in:
parent
ce1023e709
commit
0cf09986ee
1 changed files with 6 additions and 1 deletions
|
|
@ -604,9 +604,14 @@
|
|||
// 0,1,2,3 -> (charIndex=2) -> 0,1,3,4 -> (insert 2) -> 0,1,2,3,4
|
||||
for (var index in currentLineStylesCloned) {
|
||||
var numericIndex = parseInt(index, 10);
|
||||
|
||||
if (numericIndex >= charIndex) {
|
||||
currentLineStyles[numericIndex + 1] = currentLineStylesCloned[numericIndex];
|
||||
//delete currentLineStyles[index];
|
||||
|
||||
// only delete the style if there was nothing moved there
|
||||
if(!currentLineStylesCloned[numericIndex - 1]) {
|
||||
delete currentLineStyles[numericIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue