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

翻转节点 #2059

Open
haipahp opened this issue Feb 4, 2025 · 1 comment
Open

翻转节点 #2059

haipahp opened this issue Feb 4, 2025 · 1 comment

Comments

@haipahp
Copy link

haipahp commented Feb 4, 2025

想对节点进行水平翻转和垂直翻转,网上查了好多方法有获取translate,里面的scale设置成-1;还有说用节点的style设置;还有lf的settransform,我都试过都不行,甚至连settransform这个接口都没有,不知道是我的logicflow版本不对还是怎么样,求一个翻转的代码实现

@ChangeSuger
Copy link
Collaborator

有没有一种可能,用 CSS 就能实现翻转

LogicFlow 本身是基于 SVG 实现的,如果需要对某个节点进行翻转的话,在对应的节点上添加下面这个样式就行:

#mynode {
  transform: scale(-1);
}

如果是只需要水平翻转和垂直翻转,替换成 scaleXscaleY 即可。

⚠️ 通常来说只设置这个可能是不够的,还需要设置好变换中心,这里仅提供思路,具体如何设置请自行摸索~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants