-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 列头文字&icon无法正确对齐 #1515
fix: 列头文字&icon无法正确对齐 #1515
Conversation
你好, @lcx-seima CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 Hello, @lcx-seima CI run failed, please click the [Details] button for detailed log information and fix it. |
Size Change: -699 B (0%) Total Size: 252 kB
ℹ️ View Unchanged
|
Codecov Report
@@ Coverage Diff @@
## master #1515 +/- ##
==========================================
- Coverage 76.29% 76.18% -0.11%
==========================================
Files 228 229 +1
Lines 10872 11020 +148
Branches 2249 2289 +40
==========================================
+ Hits 8295 8396 +101
- Misses 1314 1337 +23
- Partials 1263 1287 +24
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
🎉 This PR is included in version @antv/s2-v1.23.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.23.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.24.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.26.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.28.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.30.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.31.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.33.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.37.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-v1.40.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix: body样式影响measureTextWidth测量结果 * refactor: 统一主题fontWeight为整数 * fix: 列头text未适配left/right对齐方式 * fix: import remove alias * test: 更新theme测试参数 * test: 列头文字对齐单元测试 * test: 修复ellipsis文字测试
👀 PR includes
🐛 Bugfix
📝 Description
列头文字&icon 无法正确对齐,主要原因有:
measureText
中 canvas 没有渲染到 dom 树,无法继承 body 上的 css 样式,导致估计值与实际值有差距g
文字中心点位置即可。后支持了left
、right
绘制,但是getTextPosition
等依旧计算的是中心点,导致有偏移效果。🖼️ Screenshot
以
textAlign=right
为例,以下 demo 分别为不带 icon 和带 icon🔍 Self-Check before the merge