Skip to content

Commit

Permalink
fix: spreadsheet.destroyed 修改为 public
Browse files Browse the repository at this point in the history
  • Loading branch information
linwrui committed Nov 8, 2024
1 parent ecb82e8 commit da484bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/s2-core/src/sheet-type/spread-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export abstract class SpreadSheet extends EE {
/**
* 表格是否已销毁
*/
private destroyed = false;
public destroyed = false;

protected abstract bindEvents(): void;

Expand Down
7 changes: 2 additions & 5 deletions packages/s2-core/src/ui/hd-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export class HdAdapter {

private zoomOffsetLeft: number | undefined;

private destroyed: boolean = false;

constructor(spreadsheet: SpreadSheet) {
this.spreadsheet = spreadsheet;
}
Expand All @@ -33,7 +31,6 @@ export class HdAdapter {
};

public destroy = () => {
this.destroyed = true;
this.removeDevicePixelRatioListener();
this.removeDeviceZoomListener();
};
Expand Down Expand Up @@ -113,7 +110,7 @@ export class HdAdapter {
private renderByDevicePixelRatio = async (
ratio = window.devicePixelRatio,
) => {
if (this.destroyed) {
if (this.spreadsheet.destroyed) {
return;
}

Expand All @@ -137,7 +134,7 @@ export class HdAdapter {
};

private renderByZoomScale = debounce(async (event: Event) => {
if (this.destroyed) {
if (this.spreadsheet.destroyed) {
return;
}

Expand Down

0 comments on commit da484bb

Please sign in to comment.