Commit 239ba42a authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix delete and isIntersectForShift

parent 34fff8d8
......@@ -374,21 +374,21 @@
Range.prototype.isIntersectForShift = function(range, offset) {
var isHor = offset && offset.offsetCol;
var toDelete = offset && (offset.offsetCol < 0 || offset.offsetRow < 0);
var isDelete = offset && (offset.offsetCol < 0 || offset.offsetRow < 0);
if (isHor) {
if (this.r1 <= range.r1 && range.r2 <= this.r2 && this.c1 <= range.c2) {
return (this.c1 < range.c1 || (this.c1 === range.c1 && this.c2 === range.c1)) ?
return (this.c1 < range.c1 || (!isDelete && this.c1 === range.c1 && this.c2 === range.c1)) ?
c_oAscShiftType.Move : c_oAscShiftType.Change;
} else if (toDelete && this.c1 <= range.c1 && range.c2 <= this.c2) {
} else if (isDelete && this.c1 <= range.c1 && range.c2 <= this.c2) {
var topIn = this.r1 <= range.r1 && range.r1 <= this.r2;
var bottomIn = this.r1 <= range.r2 && range.r2 <= this.r2;
return topIn || bottomIn;
}
} else {
if (this.c1 <= range.c1 && range.c2 <= this.c2 && this.r1 <= range.r2) {
return (this.r1 < range.r1 || (this.r1 === range.r1 && this.r2 === range.r1)) ?
return (this.r1 < range.r1 || (!isDelete && this.r1 === range.r1 && this.r2 === range.r1)) ?
c_oAscShiftType.Move : c_oAscShiftType.Change;
} else if (toDelete && this.r1 <= range.r1 && range.r2 <= this.r2) {
} else if (isDelete && this.r1 <= range.r1 && range.r2 <= this.r2) {
var leftIn = this.c1 <= range.c1 && range.c1 <= this.c2;
var rightIn = this.c1 <= range.c2 && range.c2 <= this.c2;
return leftIn || rightIn;
......
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