Commit 553a497a authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Переделал выделение залоченных элементов для совместного редактирования (баг...

Переделал выделение залоченных элементов для совместного редактирования (баг http://bugzserver/show_bug.cgi?id=21217)
Более четкая пунктирная линия

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50602 954022d7-b5bf-4e40-9824-e11837661b57
parent 21353ebd
......@@ -441,6 +441,6 @@ var c_oAscCoAuthoringMeBorderColor = "rgba(22,156,0,1)";
var c_oAscCoAuthoringOtherBorderColor = "rgba(238,53,37,1)";
var c_oAscCoAuthoringLockTablePropertiesBorderColor = "rgba(255,144,0,1)";
var c_oAscCoAuthoringDottedWidth = 2;
var c_oAscCoAuthoringDottedDistance = 1;
var c_oAscCoAuthoringDottedDistance = 2;
var FONT_THUMBNAIL_HEIGHT = parseInt(7 * 96.0 / 25.4);
......@@ -1007,6 +1007,46 @@ DrawingContext.prototype = {
this.ctx.lineTo(r.x + (dx !== undefined ? dx : 0), r.y + (dy !== undefined ? dy : 0));
return this;
},
dashLineCleverHor : function (x1, y, x2, w_dot, w_dist) {
var _x1 = this._mct.transformPointX(x1, y);
var _y = this._mct.transformPointY(x1, y);
var _x2 = this._mct.transformPointX(x2, y);
var ctx = this.ctx;
_x1 = (_x1 >> 0) + 0.5;
_y = (_y >> 0) + 0.5;
_x2 = (_x2 >> 0) + 0.5;
for (; _x1 < _x2; _x1 += w_dist) {
ctx.moveTo(_x1, _y);
_x1 += w_dot;
if (_x1 > _x2)
_x1 = _x2;
ctx.lineTo(_x1, _y);
}
},
dashLineCleverVer : function (x, y1, y2, w_dot, w_dist) {
var _y1 = this._mct.transformPointY(x, y1);
var _x = this._mct.transformPointX(x, y1);
var _y2 = this._mct.transformPointY(x, y2);
var ctx = this.ctx;
_y1 = (_y1 >> 0) + 0.5;
_x = (_x >> 0) + 0.5;
_y2 = (_y2 >> 0) + 0.5;
for (; _y1 < _y2; _y1 += w_dist) {
ctx.moveTo(_x, _y1);
_y1 += w_dot;
if (_y1 > _y2)
_y1 = _y2;
ctx.lineTo(_x, _y1);
}
},
dashLine: function (x1, y1, x2, y2, w_dot, w_dist) {
var len = Math.sqrt ((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
......
......@@ -3016,7 +3016,7 @@
offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft,
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
ctx.setLineWidth(2);
ctx.setLineWidth(1);
var oSelectRangeIntersection = oSelectRange.intersection(this.visibleRange);
if (oSelectRangeIntersection) {
......@@ -3032,10 +3032,10 @@
var ySelectRange1 = this.rows[oSelectRangeIntersection.r1].top - offsetY;
var ySelectRange2 = this.rows[oSelectRangeIntersection.r2].top + this.rows[oSelectRangeIntersection.r2].height - offsetY;
if (drawTopSideSelectRange) {ctx.dashLine(xSelectRange1, ySelectRange1, xSelectRange2, ySelectRange1, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideSelectRange) {ctx.dashLine(xSelectRange1, ySelectRange2, xSelectRange2, ySelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideSelectRange) {ctx.dashLine(xSelectRange1, ySelectRange1, xSelectRange1, ySelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideSelectRange) {ctx.dashLine(xSelectRange2, ySelectRange1, xSelectRange2, ySelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawTopSideSelectRange) {ctx.dashLineCleverHor(xSelectRange1, ySelectRange1, xSelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideSelectRange) {ctx.dashLineCleverHor(xSelectRange1, ySelectRange2, xSelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideSelectRange) {ctx.dashLineCleverVer(xSelectRange1, ySelectRange1, ySelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideSelectRange) {ctx.dashLineCleverVer(xSelectRange2, ySelectRange1, ySelectRange2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
ctx.closePath().stroke().fill();
}
......@@ -3057,7 +3057,7 @@
if (c_oAscMouseMoveLockedObjectType.None !== nLockAllType) {
var styleColor = (c_oAscMouseMoveLockedObjectType.TableProperties === nLockAllType) ?
c_oAscCoAuthoringLockTablePropertiesBorderColor : c_oAscCoAuthoringOtherBorderColor;
ctx.setStrokeStyle(styleColor).setLineWidth(2).beginPath();
ctx.setStrokeStyle(styleColor).setLineWidth(1).beginPath();
var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft;
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
......@@ -3076,10 +3076,10 @@
var yFormula1 = this.rows[aFormulaIntersection.r1].top - offsetY;
var yFormula2 = this.rows[aFormulaIntersection.r2].top + this.rows[aFormulaIntersection.r2].height - offsetY;
if (drawTopSideFormula) {ctx.dashLine(xFormula1, yFormula1, xFormula2, yFormula1, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideFormula) {ctx.dashLine(xFormula1, yFormula2, xFormula2, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideFormula) {ctx.dashLine(xFormula1, yFormula1, xFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideFormula) {ctx.dashLine(xFormula2, yFormula1, xFormula2, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawTopSideFormula) {ctx.dashLineCleverHor(xFormula1, yFormula1, xFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideFormula) {ctx.dashLineCleverHor(xFormula1, yFormula2, xFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideFormula) {ctx.dashLineCleverVer(xFormula1, yFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideFormula) {ctx.dashLineCleverVer(xFormula2, yFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
}
ctx.stroke();
......@@ -3115,7 +3115,7 @@
.rect(this.cellsLeft, this.cellsTop, ctx.getWidth() - this.cellsLeft, ctx.getHeight() - this.cellsTop)
.clip();
ctx.setStrokeStyle(styleColor).setLineWidth(2).beginPath();
ctx.setStrokeStyle(styleColor).setLineWidth(1).beginPath();
for (i = 0; i < arrayCells.length; ++i) {
var arFormulaTmp = asc_Range (arrayCells[i].c1, arrayCells[i].r1, arrayCells[i].c2, arrayCells[i].r2);
......@@ -3133,10 +3133,10 @@
var yFormula1 = this.rows[aFormulaIntersection.r1].top - offsetY;
var yFormula2 = this.rows[aFormulaIntersection.r2].top + this.rows[aFormulaIntersection.r2].height - offsetY;
if (drawTopSideFormula) {ctx.dashLine(xFormula1, yFormula1, xFormula2, yFormula1, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideFormula) {ctx.dashLine(xFormula1, yFormula2, xFormula2, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideFormula) {ctx.dashLine(xFormula1, yFormula1, xFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideFormula) {ctx.dashLine(xFormula2, yFormula1, xFormula2, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawTopSideFormula) {ctx.dashLineCleverHor(xFormula1, yFormula1, xFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawBottomSideFormula) {ctx.dashLineCleverHor(xFormula1, yFormula2, xFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawLeftSideFormula) {ctx.dashLineCleverVer(xFormula1, yFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
if (drawRightSideFormula) {ctx.dashLineCleverVer(xFormula2, yFormula1, yFormula2, c_oAscCoAuthoringDottedWidth, c_oAscCoAuthoringDottedDistance);}
}
}
......
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