fix: scrollbar overflow on zoom

This commit is contained in:
zyc9012 2023-05-02 20:31:56 +08:00 committed by tato
parent e20abcbbf6
commit 5c6877817c
2 changed files with 8 additions and 2 deletions

View File

@ -74,7 +74,13 @@ const Sheet: React.FC<Props> = ({ sheet }) => {
placeholderRef.current!
)
);
}, [refs.canvas, setContext]);
}, [
refs.canvas,
setContext,
context.rowHeaderWidth,
context.columnHeaderHeight,
context.devicePixelRatio,
]);
/**
* Recalculate freeze data when sheet changes or sheet.frozen changes

View File

@ -25,7 +25,7 @@ const ScrollBar: React.FC<Props> = ({ axis }) => {
axis === "x"
? {
left: context.rowHeaderWidth,
width: context.cellmainWidth,
width: `calc(100% - ${context.rowHeaderWidth}px)`,
}
: { height: "100%" }
}