Commit 18a2c77f authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Ускорил отрисовку одинаковых бордеров (делаем stroke в самом конце)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58038 954022d7-b5bf-4e40-9824-e11837661b57
parent 66670f42
...@@ -2644,7 +2644,7 @@ ...@@ -2644,7 +2644,7 @@
} }
} }
var bc = undefined; // cached border color var bc = null, bw = -1, isNotFirst = false, isStroke = false; // cached border color
// ToDo в одну функцию // ToDo в одну функцию
function drawBorderHor(border, x1, y, x2) { function drawBorderHor(border, x1, y, x2) {
...@@ -2652,11 +2652,23 @@ ...@@ -2652,11 +2652,23 @@
if (bc !== border.c) { if (bc !== border.c) {
bc = border.c; bc = border.c;
ctx.setStrokeStyle(bc); ctx.setStrokeStyle(bc);
isStroke = true;
} }
ctx.setLineWidth(border.w) if (bw !== border.w) {
.beginPath() bw = border.w;
.lineHor(x1, y, x2) ctx.setLineWidth(border.w);
.stroke(); isStroke = true;
}
if (isNotFirst && isStroke)
ctx.stroke().beginPath();
else if (!isNotFirst) {
isNotFirst = true;
ctx.beginPath();
}
ctx.lineHor(x1, y, x2);
isStroke = false;
} }
} }
...@@ -2665,11 +2677,23 @@ ...@@ -2665,11 +2677,23 @@
if (bc !== border.c) { if (bc !== border.c) {
bc = border.c; bc = border.c;
ctx.setStrokeStyle(bc); ctx.setStrokeStyle(bc);
isStroke = true;
} }
ctx.setLineWidth(border.w) if (bw !== border.w) {
.beginPath() bw = border.w;
.lineVer(x1, y1, y2) ctx.setLineWidth(border.w);
.stroke(); isStroke = true;
}
if (isNotFirst && isStroke)
ctx.stroke().beginPath();
else if (!isNotFirst) {
isNotFirst = true;
ctx.beginPath();
}
ctx.lineVer(x1, y1, y2);
isStroke = false;
} }
} }
...@@ -2678,11 +2702,23 @@ ...@@ -2678,11 +2702,23 @@
if (bc !== border.c) { if (bc !== border.c) {
bc = border.c; bc = border.c;
ctx.setStrokeStyle(bc); ctx.setStrokeStyle(bc);
isStroke = true;
} }
ctx.setLineWidth(border.w) if (bw !== border.w) {
.beginPath() bw = border.w;
.lineDiag(x1, y1, x2, y2) ctx.setLineWidth(border.w);
.stroke(); isStroke = true;
}
if (isNotFirst && isStroke)
ctx.stroke().beginPath();
else if (!isNotFirst) {
isNotFirst = true;
ctx.beginPath();
}
ctx.lineDiag(x1, y1, x2, y2);
isStroke = false;
} }
} }
...@@ -2904,6 +2940,9 @@ ...@@ -2904,6 +2940,9 @@
arrCurrRow = arrNextRow; arrCurrRow = arrNextRow;
arrNextRow = []; arrNextRow = [];
} }
if (isNotFirst)
ctx.stroke();
}; };
/** Рисует закрепленные области областей */ /** Рисует закрепленные области областей */
......
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