-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 修复合并单元格滚动出可视范围后边框绘制错误 close #3048
- Loading branch information
1 parent
7e30008
commit 5049c86
Showing
3 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @description spec for issue #3048 | ||
* https://github.com/antvis/S2/issues/3048 | ||
*/ | ||
import { createPivotSheet, sleep } from '../util/helpers'; | ||
|
||
describe('Merged Cells Scroll Tests', () => { | ||
test('should render correctly borders after scroll out of view', async () => { | ||
const s2 = createPivotSheet( | ||
{ | ||
width: 800, | ||
height: 600, | ||
mergedCellsInfo: [ | ||
[ | ||
{ | ||
rowIndex: 0, | ||
colIndex: 1, | ||
}, | ||
{ | ||
rowIndex: 1, | ||
colIndex: 1, | ||
showText: true, | ||
}, | ||
], | ||
], | ||
style: { | ||
dataCell: { | ||
height: 150, | ||
}, | ||
}, | ||
}, | ||
{ useSimpleData: false }, | ||
); | ||
|
||
await s2.render(); | ||
|
||
// 让合并单元格滚动出可视范围内 | ||
s2.interaction.scrollToBottom({ animate: false }); | ||
await sleep(500); | ||
|
||
// 滚动回来 | ||
s2.interaction.scrollToTop({ animate: false }); | ||
await sleep(500); | ||
|
||
const mergedCellChildNodes = s2.facet | ||
.getMergedCells()[0] | ||
.children.map((node) => node.nodeName); | ||
|
||
// 边框线正常添加 | ||
expect(mergedCellChildNodes).toEqual([ | ||
'polygon', | ||
'text', | ||
'line', | ||
'line', | ||
'line', | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters