Skip to content

Commit

Permalink
fix(sheet): default vertical align (#1383)
Browse files Browse the repository at this point in the history
* fix(render): px to pt

* fix(sheet): default bottom align
  • Loading branch information
DR-Univer committed Feb 19, 2024
1 parent 608f9df commit d96edf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/engine-render/src/components/docs/document.ts
Expand Up @@ -465,10 +465,10 @@ export class Documents extends DocComponent {
let offsetTop = 0;
if (verticalAlign === VerticalAlign.MIDDLE) {
offsetTop = (this.height - pageHeight) / 2;
} else if (verticalAlign === VerticalAlign.BOTTOM) {
offsetTop = this.height - pageHeight - pagePaddingBottom;
} else {
} else if (verticalAlign === VerticalAlign.TOP) {
offsetTop = pagePaddingTop;
} else {
offsetTop = this.height - pageHeight - pagePaddingBottom;
}
return offsetTop;
}
Expand Down
Expand Up @@ -239,12 +239,12 @@ export class StartEditController extends Disposable {
documentDataModel.updateDocumentDataMargin(paddingData);
} else {
// Set the top margin under vertical alignment.
let offsetTop = paddingData.t || 0;
let offsetTop = (editorHeight - actualHeight) || 0;

if (verticalAlign === VerticalAlign.MIDDLE) {
offsetTop = (editorHeight - actualHeight) / 2;
} else if (verticalAlign === VerticalAlign.BOTTOM) {
offsetTop = editorHeight - actualHeight;
} else if (verticalAlign === VerticalAlign.TOP) {
offsetTop = paddingData.t || 0;
}

offsetTop /= scaleY;
Expand Down

0 comments on commit d96edf0

Please sign in to comment.