TWaver Forums
http://servasoft.com/forum/

如何获取group展开状态下占据的空间
http://servasoft.com/forum/viewtopic.php?f=35&t=6240
Page 1 of 1

Author:  redeemer0228 [ 2020-09-10 16:38 ]
Post subject:  如何获取group展开状态下占据的空间

请教:如何获取group展开状态下占据的空间? getRect ()方法获取的宽高值不对;

Author:  skm_mks [ 2020-09-10 18:04 ]
Post subject:  Re: 如何获取group展开状态下占据的空间

必须等待绘图完成才能获取,除非自己可以根据提前拿到的子网元的位置计算。
获取方法
Code:
   var gu = network.getElementUI(group);
    function fn (e) {
      if (e.kind == 'validateEnd') {
        console.log('validateEnd');
        console.log(gu.getViewRect())
        network.removeViewListener(fn)
      }
    }
    network.addViewListener(fn);

Page 1 of 1 All times are UTC + 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/