Skip to content

Commit 24f4c1d

Browse files
committed
Fix the scroll issue on focus cell
We made the focus cell section always visible. Signed-off-by: Gülşah Köse <[email protected]> Change-Id: I58cdc19c79210ecc1e925c8efd0b3313b68823ef
1 parent aecf4e4 commit 24f4c1d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

browser/src/canvas/CanvasSectionContainer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ class CanvasSectionContainer {
474474
}
475475

476476
public isDocumentObjectVisible (section: CanvasSectionObject): boolean {
477-
return app.isRectangleVisibleInTheDisplayedArea(
477+
return section.isAlwaysVisible ||
478+
app.isRectangleVisibleInTheDisplayedArea(
478479
[
479480
Math.round(section.position[0] * app.pixelsToTwips),
480481
Math.round(section.position[1] * app.pixelsToTwips),

browser/src/canvas/CanvasSectionObject.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class CanvasSectionObject {
3636
zIndex: number;
3737
interactable: boolean = true;
3838
isAnimating: boolean = false;
39+
isAlwaysVisible: boolean = false;
3940
windowSection: boolean = false;
4041
sectionProperties: any = {};
4142
boundsList: Array<CanvasSectionObject> = []; // The sections those this section can propagate events to. Updated by container.

browser/src/canvas/sections/FocusCellSection.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class FocusCellSection extends CanvasSectionObject {
3737
this.sectionProperties.rowRectangle = null;
3838
this.sectionProperties.maxCol = 268435455;
3939
this.sectionProperties.maxRow = 20971124;
40+
this.isAlwaysVisible = true;
4041
}
4142

4243
public onCellAddressChanged(): void {
@@ -84,13 +85,13 @@ class FocusCellSection extends CanvasSectionObject {
8485

8586
this.context.fillRect(
8687
0,
87-
-this.position[1],
88+
-app.calc.cellCursorRectangle.pY1,
8889
app.calc.cellCursorRectangle.pWidth,
8990
this.sectionProperties.maxCol,
9091
);
9192

9293
this.context.fillRect(
93-
-this.position[0],
94+
-app.calc.cellCursorRectangle.pX1,
9495
0,
9596
this.sectionProperties.maxRow,
9697
app.calc.cellCursorRectangle.pHeight,
@@ -101,13 +102,13 @@ class FocusCellSection extends CanvasSectionObject {
101102

102103
this.context.strokeRect(
103104
0,
104-
-this.position[1],
105+
-app.calc.cellCursorRectangle.pY1,
105106
app.calc.cellCursorRectangle.pWidth,
106107
this.sectionProperties.maxCol,
107108
);
108109

109110
this.context.strokeRect(
110-
-this.position[0],
111+
-app.calc.cellCursorRectangle.pX1,
111112
0,
112113
this.sectionProperties.maxRow,
113114
app.calc.cellCursorRectangle.pHeight,

0 commit comments

Comments
 (0)