fix: row header and column header not responding to zoom

This commit is contained in:
zyc9012 2023-04-30 21:23:08 +08:00 committed by tato
parent 6f8a77849c
commit 925705b6b3

View File

@ -558,9 +558,6 @@ const Workbook = React.forwardRef<WorkbookInstance, Settings & AdditionalProps>(
draftCtx.defaultcolumnNum = mergedSettings.column;
draftCtx.defaultrowNum = mergedSettings.row;
draftCtx.defaultFontSize = mergedSettings.defaultFontSize;
draftCtx.rowHeaderWidth = mergedSettings.rowHeaderWidth || 1.5;
draftCtx.columnHeaderHeight =
mergedSettings.columnHeaderHeight || 1.5;
if (_.isEmpty(draftCtx.luckysheetfile)) {
const newData = produce(originalData, (draftData) => {
ensureSheetIndex(draftData, mergedSettings.generateSheetId);
@ -635,6 +632,10 @@ const Workbook = React.forwardRef<WorkbookInstance, Settings & AdditionalProps>(
draftCtx.insertedImgs = sheet.images;
draftCtx.zoomRatio = _.isNil(sheet.zoomRatio) ? 1 : sheet.zoomRatio;
draftCtx.rowHeaderWidth =
mergedSettings.rowHeaderWidth * draftCtx.zoomRatio;
draftCtx.columnHeaderHeight =
mergedSettings.columnHeaderHeight * draftCtx.zoomRatio;
if (!_.isNil(sheet.defaultRowHeight)) {
draftCtx.defaultrowlen = Number(sheet.defaultRowHeight);