Commit 0cd9d096 authored by Alexander.Trofimov's avatar Alexander.Trofimov

draw frozen pane with shadow

parent fffb3795
...@@ -121,6 +121,9 @@ ...@@ -121,6 +121,9 @@
ctx.fillRect(1, 1, 1, 1); ctx.fillRect(1, 1, 1, 1);
this.ptrnLineDotted1 = ctx.createPattern(cnv, "repeat"); this.ptrnLineDotted1 = ctx.createPattern(cnv, "repeat");
this.frozenImageH = new Image();
this.frozenImageH.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAKCAYAAAB10jRKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAJElEQVQYV2MAAjUQoQIiFECEDIiQABHCIIIPRHCBCDYgZmACABohANImre1SAAAAAElFTkSuQmCC';
this.halfSelection = false; this.halfSelection = false;
return this; return this;
......
...@@ -3258,48 +3258,51 @@ ...@@ -3258,48 +3258,51 @@
} }
}; };
/** Рисует закрепление областей */ /** Рисует закрепление областей */
WorksheetView.prototype._drawFrozenPaneLines = function ( drawingCtx ) { WorksheetView.prototype._drawFrozenPaneLines = function (drawingCtx) {
// Возможно стоит отрисовывать на overlay, а не на основной канве // Возможно стоит отрисовывать на overlay, а не на основной канве
var ctx = drawingCtx ? drawingCtx : this.drawingCtx; var ctx = drawingCtx ? drawingCtx : this.drawingCtx;
var lockInfo = this.collaborativeEditing.getLockInfo( c_oAscLockTypeElem.Object, null, this.model.getId(), AscCommonExcel.c_oAscLockNameFrozenPane ); var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, this.model.getId(),
var isLocked = this.collaborativeEditing.getLockIntersection( lockInfo, c_oAscLockTypes.kLockTypeOther, false ); AscCommonExcel.c_oAscLockNameFrozenPane);
var color = isLocked ? AscCommonExcel.c_oAscCoAuthoringOtherBorderColor : this.settings.frozenColor; var isLocked = this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, false);
ctx.setLineWidth( 1 ).setStrokeStyle( color ).beginPath(); var color = isLocked ? AscCommonExcel.c_oAscCoAuthoringOtherBorderColor : this.settings.frozenColor;
var fHorLine, fVerLine; ctx.setLineWidth(1).setStrokeStyle(color).beginPath();
if ( isLocked ) { var fHorLine, fVerLine;
fHorLine = ctx.dashLineCleverHor; if (isLocked) {
fVerLine = ctx.dashLineCleverVer; fHorLine = ctx.dashLineCleverHor;
} fVerLine = ctx.dashLineCleverVer;
else { } else {
fHorLine = ctx.lineHorPrevPx; fHorLine = ctx.lineHorPrevPx;
fVerLine = ctx.lineVerPrevPx; fVerLine = ctx.lineVerPrevPx;
} }
if ( this.topLeftFrozenCell ) { if (this.topLeftFrozenCell) {
var row = this.topLeftFrozenCell.getRow0(); var row = this.topLeftFrozenCell.getRow0();
var col = this.topLeftFrozenCell.getCol0(); var col = this.topLeftFrozenCell.getCol0();
if ( 0 < row ) { if (0 < row) {
fHorLine.apply( ctx, [0, this.rows[row].top, ctx.getWidth()] ); fHorLine.apply(ctx, [0, this.rows[row].top, ctx.getWidth()]);
} } else {
else { fHorLine.apply(ctx, [0, this.headersHeight, this.headersWidth]);
fHorLine.apply( ctx, [0, this.headersHeight, this.headersWidth] ); }
}
if ( 0 < col ) { if (0 < col) {
fVerLine.apply( ctx, [this.cols[col].left, 0, ctx.getHeight()] ); fVerLine.apply(ctx, [this.cols[col].left, 0, ctx.getHeight()]);
} } else {
else { fVerLine.apply(ctx, [this.headersWidth, 0, this.headersHeight]);
fVerLine.apply( ctx, [this.headersWidth, 0, this.headersHeight] );
}
}
else if ( this.model.sheetViews[0].asc_getShowRowColHeaders() ) {
fHorLine.apply( ctx, [0, this.headersHeight, this.headersWidth] );
fVerLine.apply( ctx, [this.headersWidth, 0, this.headersHeight] );
}
ctx.stroke(); }
}; ctx.stroke();
if (0 < row) {
ctx.drawImage(this.settings.frozenImageH, 0, 0, 1 * this.width_1px, 10 * this.height_1px, 0,
this.rows[row].top, ctx.getWidth(), this.height_1px * 10);
}
} else if (this.model.sheetViews[0].asc_getShowRowColHeaders()) {
fHorLine.apply(ctx, [0, this.headersHeight, this.headersWidth]);
fVerLine.apply(ctx, [this.headersWidth, 0, this.headersHeight]);
ctx.stroke();
}
};
WorksheetView.prototype.drawFrozenGuides = function ( x, y, target ) { WorksheetView.prototype.drawFrozenGuides = function ( x, y, target ) {
var data, offsetFrozen; var data, offsetFrozen;
......
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