Skip to content

Commit

Permalink
[se] Fix handle select
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaZotov committed Sep 26, 2024
1 parent 7e06f50 commit e100ba6
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions cell/view/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7467,8 +7467,8 @@
ctx.setLineWidth(1).setStrokeStyle(color).beginPath();
var fHorLine, fVerLine;
if (isLocked) {
fHorLine = ctx.dashLineCleverHor;
fVerLine = ctx.dashLineCleverVer;
fHorLine = this._dashLineCleverHor;
fVerLine = this._dashLineCleverVer;
} else {
fHorLine = ctx.lineHorPrevPx;
fVerLine = ctx.lineVerPrevPx;
Expand All @@ -7478,26 +7478,36 @@
var row = this.topLeftFrozenCell.getRow0();
var col = this.topLeftFrozenCell.getCol0();
if (0 < row) {
fHorLine.apply(ctx, [0, this._getRowTop(row), ctx.getWidth()]);
fHorLine.apply(ctx, [0, this._getRowTop(row), ctx.getWidth(), ctx]);
} else {
fHorLine.apply(ctx, [this.headersLeft, this.headersTop + this.headersHeight, this.headersLeft + this.headersWidth]);
fHorLine.apply(ctx, [this.headersLeft, this.headersTop + this.headersHeight, this.headersLeft + this.headersWidth, ctx]);
}

if (0 < col) {
fVerLine.apply(ctx, [this._getColLeft(col), 0, ctx.getHeight()]);
fVerLine.apply(ctx, [this._getColLeft(col), 0, ctx.getHeight(), ctx]);
} else {
fVerLine.apply(ctx, [this.headersLeft + this.headersWidth, this.headersTop, this.headersTop + this.headersHeight]);
fVerLine.apply(ctx, [this.headersLeft + this.headersWidth, this.headersTop, this.headersTop + this.headersHeight, ctx]);

}
ctx.stroke();

} else if (this.model.getSheetView().asc_getShowRowColHeaders()) {
fHorLine.apply(ctx, [this.headersLeft + rightToLeftOffset, this.headersTop + this.headersHeight, this.headersLeft + this.headersWidth]);
fVerLine.apply(ctx, [this.headersWidth + this.headersLeft, this.headersTop, this.headersTop + this.headersHeight]);
fHorLine.apply(ctx, [this.headersLeft + rightToLeftOffset, this.headersTop + this.headersHeight, this.headersLeft + this.headersWidth, ctx]);
fVerLine.apply(ctx, [this.headersWidth + this.headersLeft, this.headersTop, this.headersTop + this.headersHeight, ctx]);
ctx.stroke();
}
};

WorksheetView.prototype._dashLineCleverVer = function (x, y1, y2, ctx) {
ctx.dashLineCleverVer(window.rightToleft ? (ctx.getWidth() - x) : x, y1, y2)
return ctx;
};

WorksheetView.prototype._dashLineCleverHor = function (x1, y, x2, ctx) {
ctx.dashLineCleverHor(window.rightToleft ? (ctx.getWidth() - x2) : x1, y, window.rightToleft ? (ctx.getWidth() - x1) : x2)
return ctx;
};

WorksheetView.prototype.drawFrozenGuides = function ( x, y, target ) {
var data, offsetFrozen;
var ctx = this.overlayCtx;
Expand Down Expand Up @@ -7801,8 +7811,8 @@
let dashThickLine = AscCommonExcel.selectionLineType.DashThick & selectionLineType;

if (isDashLine || dashThickLine) {
fHorLine = ctx.dashLineCleverHor;
fVerLine = ctx.dashLineCleverVer;
fHorLine = this._dashLineCleverHor;
fVerLine = this._dashLineCleverVer;
} else {
fHorLine = ctx.lineHorPrevPx;
fVerLine = ctx.lineVerPrevPx;
Expand Down Expand Up @@ -7870,16 +7880,16 @@
ctx.beginPath();

if (drawTopSide && !firstRow) {
fHorLine.apply(ctx, [x1 - !isDashLine * (2 + isRetina * 1) + _diff + rightToLeftOffset*1, y1, x2 + !isDashLine * (1 + isRetina * 1) - _diff + rightToLeftOffset*1]);
fHorLine.apply(ctx, [x1 - !isDashLine * (2 + isRetina * 1) + _diff + rightToLeftOffset*1, y1, x2 + !isDashLine * (1 + isRetina * 1) - _diff + rightToLeftOffset*1, ctx]);
}
if (drawBottomSide) {
fHorLine.apply(ctx, [x1, y2 + !isDashLine * 1 - thinLineDiff, x2]);
fHorLine.apply(ctx, [x1, y2 + !isDashLine * 1 - thinLineDiff, x2, ctx]);
}
if (drawLeftSide && !firstCol) {
fVerLine.apply(ctx, [x1 - rightToLeftOffset*1, y1, y2 + !isDashLine * (1 + isRetina * 1) - _diff]);
fVerLine.apply(ctx, [x1 - rightToLeftOffset*1, y1, y2 + !isDashLine * (1 + isRetina * 1) - _diff, ctx]);
}
if (drawRightSide) {
fVerLine.apply(ctx, [x2 + !isDashLine * 1 - thinLineDiff -rightToLeftOffset*1, y1, y2 + !isDashLine * (1 + isRetina * 1)]);
fVerLine.apply(ctx, [x2 + !isDashLine * 1 - thinLineDiff -rightToLeftOffset*1, y1, y2 + !isDashLine * (1 + isRetina * 1), ctx]);
}
ctx.closePath().stroke();
}
Expand Down Expand Up @@ -7908,16 +7918,16 @@
ctx.setStrokeStyle(colorN);
ctx.beginPath();
if (drawTopSide) {
fHorLine.apply(ctx, [x1 + isRetina * 1 + rightToLeftOffset*1, y1 + 1 + isRetina * !firstRow * 1, x2 - 1 - isRetina * 1 + rightToLeftOffset*1]);
fHorLine.apply(ctx, [x1 + isRetina * 1 + rightToLeftOffset*1, y1 + 1 + isRetina * !firstRow * 1, x2 - 1 - isRetina * 1 + rightToLeftOffset*1, ctx]);
}
if (drawBottomSide) {
fHorLine.apply(ctx, [x1 + isRetina * 1+ rightToLeftOffset*1, y2 - 1 - isRetina * 1, x2 - 1 - isRetina * 1+ rightToLeftOffset*1]);
fHorLine.apply(ctx, [x1 + isRetina * 1+ rightToLeftOffset*1, y2 - 1 - isRetina * 1, x2 - 1 - isRetina * 1+ rightToLeftOffset*1, ctx]);
}
if (drawLeftSide) {
fVerLine.apply(ctx, [x1 + 1 + isRetina * !firstCol * 1, y1 + isRetina * 1, y2 - 2 - isRetina * !firstCol * 1]);
fVerLine.apply(ctx, [x1 + 1 + isRetina * !firstCol * 1, y1 + isRetina * 1, y2 - 2 - isRetina * !firstCol * 1, ctx]);
}
if (drawRightSide) {
fVerLine.apply(ctx, [x2 - 1 - isRetina * 1, y1 + isRetina * 1, y2 - 2 - isRetina * 1]);
fVerLine.apply(ctx, [x2 - 1 - isRetina * 1, y1 + isRetina * 1, y2 - 2 - isRetina * 1, ctx]);
}
ctx.closePath().stroke();
}
Expand Down

0 comments on commit e100ba6

Please sign in to comment.