Commit 3865316a authored by Alexey.Musinov's avatar Alexey.Musinov

up

parent 2de28ba9
...@@ -3229,6 +3229,9 @@ function OfflineEditor () { ...@@ -3229,6 +3229,9 @@ function OfflineEditor () {
if (-1 !== index) { if (-1 !== index) {
if (isColHeader) { if (isColHeader) {
if (w < this.width_1px) { if (w < this.width_1px) {
if (style !== kHeaderDefault) {
return;
}
// Это невидимый столбец // Это невидимый столбец
isZeroHeader = true; isZeroHeader = true;
// Отрисуем только границу // Отрисуем только границу
...@@ -3245,6 +3248,9 @@ function OfflineEditor () { ...@@ -3245,6 +3248,9 @@ function OfflineEditor () {
} }
} else { } else {
if (h < this.height_1px) { if (h < this.height_1px) {
if (style !== kHeaderDefault) {
return;
}
// Это невидимая строка // Это невидимая строка
isZeroHeader = true; isZeroHeader = true;
// Отрисуем только границу // Отрисуем только границу
...@@ -3273,7 +3279,7 @@ function OfflineEditor () { ...@@ -3273,7 +3279,7 @@ function OfflineEditor () {
if (!isZeroHeader) { if (!isZeroHeader) {
// draw background // draw background
ctx.setFillStyle(st.background) ctx.setFillStyle(st.background)
.fillRect(x, y, w + 20, h + 20); .fillRect(x, y, w + 5, h + 5);
} }
// draw border // draw border
ctx.setStrokeStyle(st.border) ctx.setStrokeStyle(st.border)
...@@ -3281,17 +3287,17 @@ function OfflineEditor () { ...@@ -3281,17 +3287,17 @@ function OfflineEditor () {
.beginPath(); .beginPath();
if (style !== kHeaderDefault && !isColHeader) { if (style !== kHeaderDefault && !isColHeader) {
// Select row (top border) // Select row (top border)
ctx.lineHorPrevPx(x, y, x2); // ctx.lineHorPrevPx(x, y, x2);
} }
// Right border // Right border
if (isColHeader) ctx.lineVerPrevPx(x2, y, y2); if (isColHeader) ctx.lineVerPrevPx(x2, y, y2 + 5);
// Bottom border // Bottom border
if (!isColHeader)ctx.lineHorPrevPx(x, y2, x2); if (!isColHeader) ctx.lineHorPrevPx(x, y2, x2 + 5);
if (style !== kHeaderDefault && isColHeader) { if (style !== kHeaderDefault && isColHeader) {
// Select col (left border) // Select col (left border)
//ctx.lineVerPrevPx(x, y, y2); ctx.lineVerPrevPx(x, y, y2);
} }
ctx.stroke(); ctx.stroke();
...@@ -3302,7 +3308,7 @@ function OfflineEditor () { ...@@ -3302,7 +3308,7 @@ function OfflineEditor () {
// draw text // draw text
var text = isColHeader ? this._getColumnTitle(index) : this._getRowTitle(index); var text = isColHeader ? this._getColumnTitle(index) : this._getRowTitle(index);
var sr = this.stringRender; var sr = this.stringRender;
var tm = this._roundTextMetrics( sr.measureString(text) ); var tm = this._roundTextMetrics(sr.measureString(text));
var bl = y2WithoutBorder - (isColHeader ? this.defaultRowDescender : this.rows[index].descender); var bl = y2WithoutBorder - (isColHeader ? this.defaultRowDescender : this.rows[index].descender);
var textX = this._calcTextHorizPos(x, x2WithoutBorder, tm, tm.width < w ? AscCommon.align_Center : AscCommon.align_Left); var textX = this._calcTextHorizPos(x, x2WithoutBorder, tm, tm.width < w ? AscCommon.align_Center : AscCommon.align_Left);
var textY = this._calcTextVertPos(y, y2WithoutBorder, bl, tm, Asc.c_oAscVAlign.Bottom); var textY = this._calcTextVertPos(y, y2WithoutBorder, bl, tm, Asc.c_oAscVAlign.Bottom);
...@@ -3323,35 +3329,34 @@ function OfflineEditor () { ...@@ -3323,35 +3329,34 @@ function OfflineEditor () {
}; };
AscCommonExcel.WorksheetView.prototype.__drawRowHeaders = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) { AscCommonExcel.WorksheetView.prototype.__drawRowHeaders = function (drawingCtx, start, end, style, offsetXForDraw, offsetYForDraw) {
if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) if (undefined === drawingCtx && false === this.model.sheetViews[0].asc_getShowRowColHeaders()) {
return; return;
}
var range = new asc_Range(0, start, 1, end);
this._prepareCellTextMetricsCache(range);
var vr = this.visibleRange; var vr = this.visibleRange;
var r = this.rows; var r = this.rows;
var offsetX = (undefined !== offsetXForDraw) ? offsetXForDraw : this.headersLeft; var offsetX = (undefined !== offsetXForDraw) ? offsetXForDraw : this.headersLeft;
var offsetY = (undefined !== offsetYForDraw) ? offsetYForDraw : r[vr.r1].top - this.cellsTop; var offsetY = (undefined !== offsetYForDraw) ? offsetYForDraw : r[vr.r1].top - this.cellsTop;
if (undefined === drawingCtx && this.topLeftFrozenCell && undefined === offsetYForDraw) { if (undefined === drawingCtx && this.topLeftFrozenCell && undefined === offsetYForDraw) {
var rFrozen = this.topLeftFrozenCell.getRow0(); var rFrozen = this.topLeftFrozenCell.getRow0();
if (start < vr.r1) if (start < vr.r1) {
offsetY = r[0].top - this.cellsTop; offsetY = r[0].top - this.cellsTop;
else } else {
offsetY -= r[rFrozen].top - r[0].top; offsetY -= r[rFrozen].top - r[0].top;
} }
}
if (asc_typeof(start) !== "number") {start = vr.r1;} if (asc_typeof(start) !== "number") {
if (asc_typeof(end) !== "number") {end = vr.r2;} start = vr.r1;
if (style === undefined) {style = kHeaderDefault;} }
if (asc_typeof(end) !== "number") {
end = vr.r2;
}
if (style === undefined) {
style = kHeaderDefault;
}
this._setFont(drawingCtx, this.model.getDefaultFontName(), this.model.getDefaultFontSize()); this._setFont(drawingCtx, this.model.getDefaultFontName(), this.model.getDefaultFontSize());
var ctx = (drawingCtx) ? drawingCtx : this.drawingCtx;
var st = this.settings.header.style[style];
ctx.setFillStyle(st.border)
.fillRect(offsetX, -offsetY, this.headersWidth * 2, r[end].top - r[start].top);
// draw row headers // draw row headers
for (var i = start; i <= end; ++i) { for (var i = start; i <= end; ++i) {
this.__drawHeader(drawingCtx, offsetX, r[i].top - r[start].top - offsetY, this.__drawHeader(drawingCtx, offsetX, r[i].top - r[start].top - offsetY,
......
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