Commit 6743f584 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Убрал $.extend, перешел на []

Добавил прототип drawSparklines
parent 0cac3da6
......@@ -2437,19 +2437,28 @@
}
};
/** Рисует спарклайны */
WorksheetView.prototype._drawSparklines = function(drawingCtx, range, offsetX, offsetY) {
};
/** Рисует ячейки таблицы */
WorksheetView.prototype._drawCells = function ( drawingCtx, range, offsetX, offsetY ) {
this._prepareCellTextMetricsCache( range );
var mergedCells = {}, mc, i;
var mergedCells = [], mc, i;
for ( var row = range.r1; row <= range.r2; ++row ) {
$.extend( mergedCells, this._drawRowBG( drawingCtx, row, range.c1, range.c2, offsetX, offsetY, null ), this._drawRowText( drawingCtx, row, range.c1, range.c2, offsetX, offsetY ) );
mergedCells =
mergedCells.concat(this._drawRowBG(drawingCtx, row, range.c1, range.c2, offsetX, offsetY, null),
this._drawRowText(drawingCtx, row, range.c1, range.c2, offsetX, offsetY));
}
// draw merged cells at last stage to fix cells background issue
for ( i in mergedCells ) {
mc = mergedCells[i];
this._drawRowBG( drawingCtx, mc.r1, mc.c1, mc.c1, offsetX, offsetY, mc );
this._drawCellText( drawingCtx, mc.c1, mc.r1, range.c1, range.c2, offsetX, offsetY, true );
for (i = 0; i < mergedCells.length; ++i) {
if (i === mergedCells.indexOf(mergedCells[i])) {
mc = mergedCells[i];
this._drawRowBG(drawingCtx, mc.r1, mc.c1, mc.c1, offsetX, offsetY, mc);
this._drawCellText(drawingCtx, mc.c1, mc.r1, range.c1, range.c2, offsetX, offsetY, true);
}
}
return mergedCells;
};
......@@ -2460,7 +2469,7 @@
return {};
}
var mergedCells = {};
var mergedCells = [];
var ctx = (undefined === drawingCtx) ? this.drawingCtx : drawingCtx;
for ( var col = colStart; col <= colEnd; ++col ) {
if ( this.cols[col].width < this.width_1px && null === oMergedCell ) {
......@@ -2480,7 +2489,7 @@
if ( null === oMergedCell ) {
mc = this.model.getMergedByCell( row, col );
if ( null !== mc ) {
mergedCells[mc.r1 + "_" + mc.c1] = {c1: mc.c1, r1: mc.r1, c2: mc.c2, r2: mc.r2};
mergedCells.push(mc);
col = mc.c2;
continue;
}
......@@ -2540,7 +2549,7 @@
return {};
}
var dependentCells = {}, mergedCells = {}, i, mc, col;
var dependentCells = {}, mergedCells = [], i, mc, col;
// draw cells' text
for ( col = colStart; col <= colEnd; ++col ) {
if ( this.cols[col].width < this.width_1px ) {
......@@ -2548,7 +2557,7 @@
}
mc = this._drawCellText( drawingCtx, col, row, colStart, colEnd, offsetX, offsetY, false );
if ( mc !== null ) {
mergedCells[mc.index] = {c1: mc.c1, r1: mc.r1, c2: mc.c2, r2: mc.r2};
mergedCells.push(mc);
}
// check if long text overlaps this cell
i = this._findSourceOfCellText( col, row );
......@@ -2584,7 +2593,7 @@
if ( isMerged ) {
range = ct.flags.merged;
if ( !drawMergedCells ) {
return {c1: range.c1, r1: range.r1, c2: range.c2, r2: range.r2, index: range.r1 + "_" + range.c1};
return range;
}
if ( col !== range.c1 || row !== range.r1 ) {
return null;
......
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