-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: fix item size while zooming #5097
Conversation
@@ -215,8 +218,20 @@ export default class Node extends Item { | |||
const { graph, group, labelGroup, displayModel, shapeMap, renderExt } = | |||
this; | |||
const [x, y, z] = group.getPosition(); | |||
const renderBounds = group.getRenderBounds(); |
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.
这块是为什么,我记得 renderBoundsCache 都删掉了。为什么需要一个 dy 偏移
|
||
const balanceLabelShape = () => { | ||
item.updateLabelPosition(); | ||
item.displayModel.labelShapeVisible = true; |
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.
这里为什么需要有这个标记位,直接去改 displayModel 不太好,displayModel 是每次渲染会被重新生成的,这样改可能会被覆盖
} | ||
const balanceRatioCache = this.zoomCache.balanceRatio.get(id); | ||
const newBalanceRatio = balanceRatioCache * balanceRatio; | ||
group.style.transform = `scale(${newBalanceRatio}, ${newBalanceRatio})`; |
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.
边上的文本自动旋转的情况下,labelShape 图形上会有 transform: 'rotate(xx)',看看会不会产生冲突
这个 Feature 有进度嘛?后边会合入不 |
画布缩放时固定元素大小
zoom-canvas
交互新增配置项fixSelectedItems
支持在画布缩放过程中固定元素大小fixSelectedItems
可选:效果图:
fixAll: true
fixLabel: true; fixLineWidth: true