Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: cell margin bottom should over 1 (#3595)

lumix65ee6b2a188c
diff --git a/packages/engine-render/src/components/sheets/sheet-skeleton.ts b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
index 842f24c284..b9e356d0aa 100644
--- a/packages/engine-render/src/components/sheets/sheet-skeleton.ts
+++ b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
@@ -227,7 +227,7 @@ export interface IDocumentLayoutObject {
export const DEFAULT_PADDING_DATA = {
t: 0,
- b: 1,
+ b: 2, // must over 1, see https://github.com/dream-num/univer/issues/2727
l: 2,
r: 2,
};
@@ -1931,12 +1931,7 @@ export class SpreadsheetSkeleton extends Skeleton {
const contentLength = content.length;
const {
textRotation,
- paddingData = {
- t: 0,
- r: 2,
- b: 2, // must over 1, see https://github.com/dream-num/univer/issues/2727
- l: 2,
- },
+ paddingData = DEFAULT_PADDING_DATA,
horizontalAlign = HorizontalAlign.UNSPECIFIED,
verticalAlign = VerticalAlign.UNSPECIFIED,
wrapStrategy = WrapStrategy.UNSPECIFIED,
diff --git a/packages/sheets-ui/src/controllers/editor/__tests__/end-edit.controller.spec.ts b/packages/sheets-ui/src/controllers/editor/__tests__/end-edit.controller.spec.ts
index 5fdfca835e..1401eaf14c 100644
--- a/packages/sheets-ui/src/controllers/editor/__tests__/end-edit.controller.spec.ts
+++ b/packages/sheets-ui/src/controllers/editor/__tests__/end-edit.controller.spec.ts
@@ -63,7 +63,7 @@ const richTextDemo: IDocumentData = {
wrapStrategy: 0,
},
marginTop: 0,
- marginBottom: 1,
+ marginBottom: 2,
marginRight: 2,
marginLeft: 2,
},
@@ -361,7 +361,7 @@ describe('Test EndEditController', () => {
width: 320.4903259277344,
},
marginTop: 0,
- marginBottom: 1,
+ marginBottom: 2,
marginRight: 2,
marginLeft: 2,
renderConfig: {
diff --git a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-form-excel.spec.ts b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-form-excel.spec.ts
index 48d2bb2168..8302a12be8 100644
--- a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-form-excel.spec.ts
+++ b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-form-excel.spec.ts
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-import type { ICellData, Injector, IStyleData, Nullable, Univer } from '@univerjs/core';
import { ICommandService, IUniverInstanceService, LocaleType, RANGE_TYPE } from '@univerjs/core';
import {
AddWorksheetMergeMutation,
@@ -27,9 +26,10 @@ import {
SheetsSelectionsService,
} from '@univerjs/sheets';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
+import type { ICellData, Injector, IStyleData, Nullable, Univer } from '@univerjs/core';
-import { ISheetClipboardService } from '../clipboard.service';
import { SheetSkeletonManagerService } from '../../sheet-skeleton-manager.service';
+import { ISheetClipboardService } from '../clipboard.service';
import { clipboardTestBed } from './clipboard-test-bed';
import { excelSample } from './constant';
@@ -164,7 +164,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
diff --git a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-from-google.spec.ts b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-from-google.spec.ts
index 55af7ffd0c..a3c8cf5786 100644
--- a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-from-google.spec.ts
+++ b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-paste-from-google.spec.ts
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-import type { ICellData, Injector, IStyleData, Nullable, Univer } from '@univerjs/core';
import { ICommandService, IUniverInstanceService, LocaleType, RANGE_TYPE } from '@univerjs/core';
import {
AddWorksheetMergeMutation,
@@ -27,11 +26,12 @@ import {
SheetsSelectionsService,
} from '@univerjs/sheets';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
-
-import { ISheetClipboardService } from '../clipboard.service';
+import type { ICellData, Injector, IStyleData, Nullable, Univer } from '@univerjs/core';
import { SheetSkeletonManagerService } from '../../sheet-skeleton-manager.service';
+import { ISheetClipboardService } from '../clipboard.service';
+
import { clipboardTestBed } from './clipboard-test-bed';
import { googleSample } from './constant';
@@ -165,7 +165,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
diff --git a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-service.spec.ts b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-service.spec.ts
index 7104162848..93a85995f0 100644
--- a/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-service.spec.ts
+++ b/packages/sheets-ui/src/services/clipboard/__tests__/clipboard-service.spec.ts
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-import type { ICellData, Injector, IRange, IStyleData, Nullable, Univer } from '@univerjs/core';
import { ICommandService, IUniverInstanceService, RANGE_TYPE, Rectangle, RedoCommand, UndoCommand } from '@univerjs/core';
import {
AddWorksheetMergeMutation,
@@ -27,13 +26,14 @@ import {
SheetsSelectionsService,
} from '@univerjs/sheets';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
+import type { ICellData, Injector, IRange, IStyleData, Nullable, Univer } from '@univerjs/core';
+import { discreteRangeToRange } from '../../../controllers/utils/range-tools';
import { ISheetClipboardService, PREDEFINED_HOOK_NAME } from '../clipboard.service';
import { COPY_TYPE } from '../type';
-import { discreteRangeToRange } from '../../../controllers/utils/range-tools';
import { clipboardTestBed } from './clipboard-test-bed';
-import type { IClipboardItem } from './mock-clipboard';
import { MockClipboard } from './mock-clipboard';
+import type { IClipboardItem } from './mock-clipboard';
describe('Test clipboard', () => {
let univer: Univer;
@@ -176,7 +176,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -249,7 +249,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -322,7 +322,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -399,7 +399,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -443,7 +443,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -527,7 +527,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -571,7 +571,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -693,7 +693,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -831,7 +831,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,
@@ -958,7 +958,7 @@ describe('Test clipboard', () => {
s: 0,
},
pd: {
- b: 1,
+ b: 2,
l: 2,
r: 2,
t: 0,