-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(theme): 背景 rect 的 bbox 在 slider 重新布局后 没有覆盖全 canvas #3998
Conversation
🎊 PR Preview eb0a941 has been successfully built and deployed to https://antvis-G2-preview-pr-3998.surge.sh?type=diff&date=2022-06-27 🕐 Build time: 64.949s 🤖 By Surge Ui Insight |
src/chart/view.ts
Outdated
const { x, y, width, height } = this.viewBBox; | ||
const { x, y } = this.viewBBox; | ||
|
||
// slider, scrollbar 的 layout 会让 viewBBox 被剪切 cut 导致使用 viewBBox 获取宽高时重新剪切后的,覆盖不到 slider、scrollbar |
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.
应该修改 layout,让 viewBBox 不被裁减。理论上 viewBBox 就是整个 view 的大小,coordinateBBox 才是除去四周的组件(axis、slider 等)距离之后的大小。
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.
@hustcc 修改好了
@@ -96,6 +96,8 @@ export class View extends Base { | |||
|
|||
/** view 区域空间。 */ | |||
public viewBBox: BBox; | |||
/** 内容 区域空间。 */ | |||
public contentBBox?: BBox; |
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.
不能这么增加变量,现在有 viewBBox 和 coordinateBBox,两个变量是足够使用的,反而增加一个变量,这三个变量直接互相定位没法区别。
看下是不是和这个 PR 的问题是一样的,coordinate 更新之后,没有更新 controller 组件的位置 |
@visiky 和这个感觉差距有点大。 这个主要不是 coordinateBox 的问题。 而是 viewBBox 的问题。 slider 和 scrollbar 会裁剪掉 viewBBox 的 来记录自己的位置。 导致黑色背景覆盖不到 slider 和 scrollbar。 所以我这边才用的 新 contentBBox 。 单纯的 viewBBox 和 coordinateBBox 不够。 需要一个新的 bbox 属性去记录位置。 |
这个 PR 先关闭了。 |
fixed #2484