From 478dcb2bcdf9be2abde518cb3c59cb6fdf3cc04e Mon Sep 17 00:00:00 2001 From: wjgogogo <906626481@qq.com> Date: Mon, 15 Jan 2024 17:34:09 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=8D=95=E6=B5=8B=E4=BF=AE=E5=A4=8D,?= =?UTF-8?q?=20row=20=E5=B8=A6=E5=BA=8F=E5=8F=B7=E6=97=B6=20clip=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spreadsheet/__snapshots__/multi-line-text-spec.ts.snap | 6 +++--- packages/s2-core/src/facet/header/row.ts | 4 ++-- packages/s2-core/src/facet/header/series-number.ts | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap index c4c6c90d1d..f9206280f8 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap @@ -2428,12 +2428,12 @@ Array [ "width": 96, }, Object { - "actualText": "城我是省略号", + "actualText": "城市城@@@", "actualTextHeight": 16, - "actualTextWidth": 73, + "actualTextWidth": 72, "height": 30, "multiLineActualTexts": Array [ - "城我是省略号", + "城市城@@@", ], "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", "width": 96, diff --git a/packages/s2-core/src/facet/header/row.ts b/packages/s2-core/src/facet/header/row.ts index 147a22b289..0d08e50847 100644 --- a/packages/s2-core/src/facet/header/row.ts +++ b/packages/s2-core/src/facet/header/row.ts @@ -140,7 +140,7 @@ export class RowHeader extends BaseHeader { this.scrollGroup.style.clipPath = new Rect({ style: { - x: position.x, + x: spreadsheet.facet.cornerBBox.x, y: position.y + frozenRowGroupHeight, width, height: viewportHeight, @@ -149,7 +149,7 @@ export class RowHeader extends BaseHeader { this.frozenRowGroup.style.clipPath = new Rect({ style: { - x: position.x, + x: spreadsheet.facet.cornerBBox.x, y: position.y, width, height: frozenRowGroupHeight, diff --git a/packages/s2-core/src/facet/header/series-number.ts b/packages/s2-core/src/facet/header/series-number.ts index 640b514b6e..388017f368 100644 --- a/packages/s2-core/src/facet/header/series-number.ts +++ b/packages/s2-core/src/facet/header/series-number.ts @@ -65,12 +65,13 @@ export class SeriesNumberHeader extends BaseHeader { } public clip(): void { - const { width, height, viewportHeight } = this.getHeaderConfig(); + const { width, height, viewportHeight, position, spreadsheet } = + this.getHeaderConfig(); this.style.clipPath = new Rect({ style: { - x: 0, - y: 0, + x: spreadsheet.facet.cornerBBox.x, + y: position.y, width, height: height + viewportHeight, },