fix: fix ellipsis error in _disableColumnAndRowSizeRound mode #1884

This commit is contained in:
Rui-Sun 2024-06-11 16:30:29 +08:00
parent bc963994d1
commit 3fe8430fb1
5 changed files with 16 additions and 6 deletions

View File

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix ellipsis error in _disableColumnAndRowSizeRound mode #1884",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}

View File

@ -500,7 +500,7 @@ export function updateCell(col: number, row: number, table: BaseTableAPI, addNew
lineClamp,
wordBreak: 'break-word',
// widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),
heightLimit: cellHeight - (padding[0] + padding[2]),
heightLimit: cellHeight - Math.floor(padding[0] + padding[2]),
pickable: false,
dx: textAlign === 'left' ? hierarchyOffset : 0,
x

View File

@ -191,7 +191,7 @@ function createCheckbox(
lineClamp,
wordBreak: 'break-word',
// widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),
heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
pickable: false,
dx: hierarchyOffset,
whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'

View File

@ -160,7 +160,7 @@ function createRadio(
lineClamp,
wordBreak: 'break-word',
// widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),
heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
pickable: false,
dx: hierarchyOffset
// whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'

View File

@ -103,7 +103,7 @@ export function createCellContent(
heightLimit:
autoRowHeight && !table.options.customConfig?.multilinesForXTable
? -1
: cellHeight - (padding[0] + padding[2]),
: cellHeight - Math.floor(padding[0] + padding[2]),
pickable: false,
dx: (textAlign === 'left' ? hierarchyOffset : 0) + _contentOffset,
whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
@ -221,7 +221,7 @@ export function createCellContent(
heightLimit:
autoRowHeight && !table.options.customConfig?.multilinesForXTable
? -1
: cellHeight - (padding[0] + padding[2]),
: cellHeight - Math.floor(padding[0] + padding[2]),
pickable: false,
autoWrapText,
lineClamp,
@ -673,7 +673,7 @@ export function updateCellContentHeight(
textAlign: CanvasTextAlign,
textBaseline: CanvasTextBaseline
) {
const newHeight = distHeight - (padding[0] + padding[2]);
const newHeight = distHeight - Math.floor(padding[0] + padding[2]);
const textMark = cellGroup.getChildByName('text');