Giter VIP home page Giter VIP logo

Comments (12)

wrh4585 avatar wrh4585 commented on August 24, 2024

目前解决了rect类型节点的改变size,但是对于非rect类型如circle和path类型的,改变size的操作,视图不刷新,还有对于节点内部的svg图标,改变大小后,并没有改变大小,还需要继续实现这块。尝试了更新节点外层的group的大小,以期达到对circle及path类型节点的大小改变,并没有成功,存在报错。。。如果大佬有时间,想请教下这块具体的实现。
目前改变rect类型的几点,是通过keyShape.attr()实现的。
如有打扰,还望见谅~!

from wfd.

guozhaolong avatar guozhaolong commented on August 24, 2024

circle大小是半径r控制的,path大小只能是重新绘制了吧,这俩应该都没有width和height参数

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

circle大小是半径r控制的,path大小只能是重新绘制了吧,这俩应该都没有width和height参数
circle是r控制的,重新赋值r,但是没有效果,具体原因还不清楚,path类型的应该是只有重新绘制了,目前在解决rect类型改变大小后,内部的图标大小不变的问题。。。

from wfd.

guozhaolong avatar guozhaolong commented on August 24, 2024

这个你要用trasform做了,就是放大缩小,下面是我触发节点动画时写的代码片段,效果是让节点放大缩小
import { mat3, transform } from '@antv/matrix-util';
const diff = ratio <= 0.5 ? ratio + 0.5 : (1 - ratio) + 0.5;
const matrix = mat3.create();
const toMatrix = transform(matrix, [['s', diff, diff]]);

from wfd.

guozhaolong avatar guozhaolong commented on August 24, 2024

官方文档

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

好的,我去看看,谢谢大佬

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

请教下,这个transform具体应该怎么写呢?在节点中怎么调用?我现在是在更新节点的size的方法里,找到了那个image的节点,但是怎么让这个transform生效呢?

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

基本上实现了,但是存在一些问题,例如缩放是的缩放比例,我是通过记录前一次次设置宽高时的width和height,与本次设置宽高的width和height做比值,作为缩放的比例,虽然可以达到随着宽高的增加放大,宽高减小时缩小,在缩小时,图片的缩小幅度小于节点的缩小幅度,最终图片会超出节点范围。。。
icon是否可以像上面通过keyShape.attr()来重新赋值宽高,如果可以节点注册时应该怎样修改配置?

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

汗,功能实现了,属性attr写成了attrs,可以将节点的image的实例拿到,然后通过attr设置宽高就可以了,用transform应该也是可以的,可能是我写的不合适,缩放的比例设置后,有点问题。总之还是谢谢大佬的思路,谢谢啦!^_^

from wfd.

guozhaolong avatar guozhaolong commented on August 24, 2024

哈哈实现了就好

from wfd.

wrh4585 avatar wrh4585 commented on August 24, 2024

哈哈实现了就好

请教下,导出XML的bpmn.js文件里,是否每个节点类型都需要在json.nodes.froEach()中进行添加,节点的写法是否可以参照您原来的写法就行?目前定义了五大类,四十多种节点,是否每个节点都需要添加呢?

from wfd.

guozhaolong avatar guozhaolong commented on August 24, 2024

如果你都用到了就要添加吧,我之前没用到flowable那么多节点

from wfd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.