fix: table cell vertical align error after page scaled #165

Co-authored-by: turingcat <tuburing@gmail.com>
This commit is contained in:
turingcat
2023-03-31 09:36:46 +08:00
committed by GitHub
co-authored by turingcat
parent f11d5c806e
commit 1fa1d10fc9
+1 -1
View File
@@ -135,7 +135,7 @@ export class Position {
|| td.verticalAlign == VerticalAlign.BOTTOM || td.verticalAlign == VerticalAlign.BOTTOM
) { ) {
const rowsHeight = rowList.reduce((pre, cur) => pre + cur.height, 0) const rowsHeight = rowList.reduce((pre, cur) => pre + cur.height, 0)
const blankHeight = td.height! - tdGap - rowsHeight const blankHeight = (td.height! - tdGap) * scale - rowsHeight
const offsetHeight = td.verticalAlign === VerticalAlign.MIDDLE ? blankHeight / 2 : blankHeight const offsetHeight = td.verticalAlign === VerticalAlign.MIDDLE ? blankHeight / 2 : blankHeight
if (Math.floor(offsetHeight) > 0) { if (Math.floor(offsetHeight) > 0) {
td.positionList.forEach(tdPosition => { td.positionList.forEach(tdPosition => {