Commit fcb31308 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Правки для отрисовки выделения при scroll для pane

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53117 954022d7-b5bf-4e40-9824-e11837661b57
parent 9daa9a58
...@@ -1885,14 +1885,14 @@ ...@@ -1885,14 +1885,14 @@
this._drawColumnHeaders(/*drawingCtx*/ undefined, c1, c2, kHeaderActive); this._drawColumnHeaders(/*drawingCtx*/ undefined, c1, c2, kHeaderActive);
this._drawRowHeaders(/*drawingCtx*/ undefined, r1, r2, kHeaderActive); this._drawRowHeaders(/*drawingCtx*/ undefined, r1, r2, kHeaderActive);
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
var cFrozen = this.topLeftFrozenCell.getCol0(); var cFrozen = this.topLeftFrozenCell.getCol0() - 1;
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0() - 1;
if (0 !== cFrozen) { if (0 <= cFrozen) {
c1 = Math.max(0, arn.c1); c1 = Math.max(0, arn.c1);
c2 = Math.min(cFrozen, arn.c2); c2 = Math.min(cFrozen, arn.c2);
this._drawColumnHeaders(/*drawingCtx*/ undefined, c1, c2, kHeaderActive); this._drawColumnHeaders(/*drawingCtx*/ undefined, c1, c2, kHeaderActive);
} }
if (0 !== rFrozen) { if (0 <= rFrozen) {
r1 = Math.max(0, arn.r1); r1 = Math.max(0, arn.r1);
r2 = Math.min(rFrozen, arn.r2); r2 = Math.min(rFrozen, arn.r2);
this._drawRowHeaders(/*drawingCtx*/ undefined, r1, r2, kHeaderActive); this._drawRowHeaders(/*drawingCtx*/ undefined, r1, r2, kHeaderActive);
...@@ -2911,21 +2911,23 @@ ...@@ -2911,21 +2911,23 @@
if (!isFrozen) { if (!isFrozen) {
var oFrozenRange; var oFrozenRange;
if (0 < cFrozen && 0 < rFrozen) { cFrozen -= 1; rFrozen -= 1;
oFrozenRange = new asc_Range(0, 0, cFrozen - 1, rFrozen - 1); if (0 <= cFrozen && 0 <= rFrozen) {
oFrozenRange = new asc_Range(0, 0, cFrozen, rFrozen);
this._drawSelectionRange(oFrozenRange, true); this._drawSelectionRange(oFrozenRange, true);
} }
if (0 < cFrozen) { if (0 <= cFrozen) {
oFrozenRange = new asc_Range(0, this.visibleRange.r1, cFrozen - 1, this.visibleRange.r2); oFrozenRange = new asc_Range(0, this.visibleRange.r1, cFrozen, this.visibleRange.r2);
this._drawSelectionRange(oFrozenRange, true); this._drawSelectionRange(oFrozenRange, true);
} }
if (0 < rFrozen) { if (0 <= rFrozen) {
oFrozenRange = new asc_Range(this.visibleRange.c1, 0, this.visibleRange.c2, rFrozen - 1); oFrozenRange = new asc_Range(this.visibleRange.c1, 0, this.visibleRange.c2, rFrozen);
this._drawSelectionRange(oFrozenRange, true); this._drawSelectionRange(oFrozenRange, true);
} }
} }
} }
var tmpRange = range;
if (!this.isSelectionDialogMode) if (!this.isSelectionDialogMode)
range = this.activeRange.intersection(range !== undefined ? range : this.visibleRange); range = this.activeRange.intersection(range !== undefined ? range : this.visibleRange);
else else
...@@ -2953,8 +2955,18 @@ ...@@ -2953,8 +2955,18 @@
var ctx = this.overlayCtx; var ctx = this.overlayCtx;
var opt = this.settings; var opt = this.settings;
var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft - diffWidth; var offsetX, offsetY;
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop - diffHeight; if (isFrozen) {
if (tmpRange.c1 !== this.visibleRange.c1)
diffWidth = 0;
if (tmpRange.r1 !== this.visibleRange.r1)
diffHeight = 0;
offsetX = this.cols[tmpRange.c1].left - this.cellsLeft - diffWidth;
offsetY = this.rows[tmpRange.r1].top - this.cellsTop - diffHeight;
} else {
offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft - diffWidth;
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop - diffHeight;
}
var arn = (!this.isSelectionDialogMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true); var arn = (!this.isSelectionDialogMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true);
var x1 = (range) ? (this.cols[range.c1].left - offsetX - this.width_1px) : 0; var x1 = (range) ? (this.cols[range.c1].left - offsetX - this.width_1px) : 0;
...@@ -3196,8 +3208,8 @@ ...@@ -3196,8 +3208,8 @@
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop; offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
var cFrozen = this.topLeftFrozenCell.getCol0(); var cFrozen = this.topLeftFrozenCell.getCol0();
offsetX -= this.cols[cFrozen].left - this.cols[0].left;
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0();
offsetX -= this.cols[cFrozen].left - this.cols[0].left;
offsetY -= this.rows[rFrozen].top - this.rows[0].top; offsetY -= this.rows[rFrozen].top - this.rows[0].top;
} }
...@@ -3330,8 +3342,8 @@ ...@@ -3330,8 +3342,8 @@
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop; var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
var cFrozen = this.topLeftFrozenCell.getCol0(); var cFrozen = this.topLeftFrozenCell.getCol0();
offsetX -= this.cols[cFrozen].left - this.cols[0].left;
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0();
offsetX -= this.cols[cFrozen].left - this.cols[0].left;
offsetY -= this.rows[rFrozen].top - this.rows[0].top; offsetY -= this.rows[rFrozen].top - this.rows[0].top;
} }
var i; var i;
...@@ -3399,8 +3411,7 @@ ...@@ -3399,8 +3411,7 @@
var arnIntersection = arn.intersectionSimple(range ? range : this.visibleRange); var arnIntersection = arn.intersectionSimple(range ? range : this.visibleRange);
var width = ctx.getWidth(); var width = ctx.getWidth();
var height = ctx.getHeight(); var height = ctx.getHeight();
var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft; var offsetX, offsetY, diffWidth, diffHeight;
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
var x1 = Number.MAX_VALUE; var x1 = Number.MAX_VALUE;
var x2 = -Number.MAX_VALUE; var x2 = -Number.MAX_VALUE;
var y1 = Number.MAX_VALUE; var y1 = Number.MAX_VALUE;
...@@ -3410,25 +3421,37 @@ ...@@ -3410,25 +3421,37 @@
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
var cFrozen = this.topLeftFrozenCell.getCol0(); var cFrozen = this.topLeftFrozenCell.getCol0();
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0();
offsetX -= this.cols[cFrozen].left - this.cols[0].left; diffWidth = this.cols[cFrozen].left - this.cols[0].left;
offsetY -= this.rows[rFrozen].top - this.rows[0].top; diffHeight = this.rows[rFrozen].top - this.rows[0].top;
if (!isFrozen) { if (!isFrozen) {
var oFrozenRange; var oFrozenRange;
if (0 < cFrozen && 0 < rFrozen) { cFrozen -= 1; rFrozen -= 1;
if (0 <= cFrozen && 0 <= rFrozen) {
oFrozenRange = new asc_Range(0, 0, cFrozen, rFrozen); oFrozenRange = new asc_Range(0, 0, cFrozen, rFrozen);
this.cleanSelection(oFrozenRange, true); this.cleanSelection(oFrozenRange, true);
} }
if (0 < cFrozen) { if (0 <= cFrozen) {
oFrozenRange = new asc_Range(0, this.visibleRange.r1, cFrozen, this.visibleRange.r2); oFrozenRange = new asc_Range(0, this.visibleRange.r1, cFrozen, this.visibleRange.r2);
this.cleanSelection(oFrozenRange, true); this.cleanSelection(oFrozenRange, true);
} }
if (0 < rFrozen) { if (0 <= rFrozen) {
oFrozenRange = new asc_Range(this.visibleRange.c1, 0, this.visibleRange.c2, rFrozen); oFrozenRange = new asc_Range(this.visibleRange.c1, 0, this.visibleRange.c2, rFrozen);
this.cleanSelection(oFrozenRange, true); this.cleanSelection(oFrozenRange, true);
} }
} }
} }
if (isFrozen) {
if (range.c1 !== this.visibleRange.c1)
diffWidth = 0;
if (range.r1 !== this.visibleRange.r1)
diffHeight = 0;
offsetX = this.cols[range.c1].left - this.cellsLeft - diffWidth;
offsetY = this.rows[range.r1].top - this.cellsTop - diffHeight;
} else {
offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft - diffWidth;
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop - diffHeight;
}
if (arnIntersection) { if (arnIntersection) {
x1 = this.cols[arnIntersection.c1].left - offsetX - this.width_2px; x1 = this.cols[arnIntersection.c1].left - offsetX - this.width_2px;
......
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