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

group分组,缩放后坐标发生偏差 #1417

Closed
Tracked by #1446
CHEN0819 opened this issue Nov 7, 2023 · 5 comments · Fixed by #1552
Closed
Tracked by #1446

group分组,缩放后坐标发生偏差 #1417

CHEN0819 opened this issue Nov 7, 2023 · 5 comments · Fixed by #1552
Labels
bug Something isn't working

Comments

@CHEN0819
Copy link

CHEN0819 commented Nov 7, 2023

发生了什么?

  1. 分组缩放后,使用this.lf?.getGraphRawData()获取数据,重新渲染流程图 this.lf?.render(),节点之间连接线坐标出现偏差。
  2. 代码:
    import { GroupNode } from '@logicflow/extension'; class WhenGroup extends GroupNode.view {} class WhenGroupModel extends GroupNode.model { getNodeStyle() { // const style = super.getNodeStyle(); // style.stroke = '#AEAFAE'; // style.strokeDasharray = '33'; // style.strokeWidth = 1; const style = super.getNodeStyle(); style.stroke = '#989891'; style.strokeWidth = 1; style.strokeDasharray = '3 3'; if (this.isSelected) { style.stroke = 'rgb(124, 15, 255)'; } if (this.isFolded) { style.fill = '#47C769'; } return style; } initNodeData(data) { super.initNodeData(data); this.text.editable = false; this.isRestrict = true; this.resizable = true; this.foldable = true; this.width = 500; this.height = 300; this.foldedWidth = 50; this.foldedHeight = 50; this.setProperties({ nodeType: 'WHEN', }); const rule = { message: '不能连接自己', validate: (sourceNode, targetNode) => { return sourceNode.id !== targetNode.id; }, }; this.sourceRules.push(rule); } getAnchorStyle(anchorInfo) { const style = super.getAnchorStyle(anchorInfo); style.stroke = '#666'; style.fill = '#fff'; style.hover.fill = 'transparent'; style.hover.stroke = 'transparent'; return style; } } export default { type: 'WhenGroupNode', view: WhenGroup, model: WhenGroupModel, };

logicFlowGroup

logicflow/core版本

^1.2.3

logicflow/extension版本

^1.2.3

logicflow/engine版本

No response

浏览器&环境

Chrome

@CHEN0819 CHEN0819 added the bug Something isn't working label Nov 7, 2023
@wumail
Copy link
Collaborator

wumail commented Nov 7, 2023

去掉网格试试

@CHEN0819
Copy link
Author

CHEN0819 commented Nov 8, 2023

一样的效果 还是错位的

@wumail
Copy link
Collaborator

wumail commented Nov 8, 2023

一样的效果 还是错位的

从表现看,缩放节点的缩放没有步长限制,调整之后缩放节点的位置和组内节点都会有0.5的偏差,重新渲染的时候四舍五入了,导致位置有偏差。建议你自己处理一下graphData再渲染,短期内可能不会处理缩放节点相关的问题
#1384 一样的问题

@CHEN0819
Copy link
Author

CHEN0819 commented Nov 8, 2023

请问啥时候会解决呢,缩放是很常见的功能的吧。分组 、泳道图都会用到这个功能的哎

@DymoneLewis
Copy link
Collaborator

请问啥时候会解决呢,缩放是很常见的功能的吧。分组 、泳道图都会用到这个功能的哎

您好,辛苦升级到1.2.26版本试一下呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants