Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

ai-qing-hai
Copy link
Collaborator

@ai-qing-hai ai-qing-hai commented Jun 23, 2022

before after
image image

fixed #2484

@github-actions
Copy link

github-actions bot commented Jun 23, 2022

🎊 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

const { x, y, width, height } = this.viewBBox;
const { x, y } = this.viewBBox;

// slider, scrollbar 的 layout 会让 viewBBox 被剪切 cut 导致使用 viewBBox 获取宽高时重新剪切后的,覆盖不到 slider、scrollbar
Copy link
Member

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 等)距离之后的大小。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hustcc 修改好了

@github-actions github-actions bot added bugfix and removed bugfix labels Jun 27, 2022
@@ -96,6 +96,8 @@ export class View extends Base {

/** view 区域空间。 */
public viewBBox: BBox;
/** 内容 区域空间。 */
public contentBBox?: BBox;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能这么增加变量,现在有 viewBBox 和 coordinateBBox,两个变量是足够使用的,反而增加一个变量,这三个变量直接互相定位没法区别。

@visiky
Copy link
Member

visiky commented Jul 4, 2022

看下是不是和这个 PR 的问题是一样的,coordinate 更新之后,没有更新 controller 组件的位置

@ai-qing-hai
Copy link
Collaborator Author

@visiky 和这个感觉差距有点大。 这个主要不是 coordinateBox 的问题。 而是 viewBBox 的问题。 slider 和 scrollbar 会裁剪掉 viewBBox 的 来记录自己的位置。 导致黑色背景覆盖不到 slider 和 scrollbar。 所以我这边才用的 新 contentBBox 。 单纯的 viewBBox 和 coordinateBBox 不够。 需要一个新的 bbox 属性去记录位置。

@hustcc
Copy link
Member

hustcc commented Sep 9, 2022

这个 PR 先关闭了。

@hustcc hustcc closed this Sep 9, 2022
@hustcc hustcc deleted the fix-background-bbox branch September 9, 2022 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

g2 如何给画布背景色,下载图片时背景色是透明的,使用theme无作用
3 participants