Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/412.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript KUTE.js svg路径不变形_Javascript_Svg_Path_Morphing - Fatal编程技术网

Javascript KUTE.js svg路径不变形

Javascript KUTE.js svg路径不变形,javascript,svg,path,morphing,Javascript,Svg,Path,Morphing,如您所见,路径没有变形。 我已经得出结论,问题在于svg本身,它们没有变形。 有什么问题吗?这些形状非常简单,所有形状都具有相同的大小和锚定,如图所示,“闭合形状(其d属性以z结尾)。” 最新版本解决了此问题。插件没有处理两个多边形具有相同点数的情况 有争议的代码 if ( s.length !== e.length ){ arL = Math.max(s.length,e.length); if ( arL === e.length) { sm = s; lg = e;

如您所见,路径没有变形。 我已经得出结论,问题在于svg本身,它们没有变形。 有什么问题吗?这些形状非常简单,所有形状都具有相同的大小和锚定,如图所示,“闭合形状(其d属性以z结尾)。”


最新版本解决了此问题。插件没有处理两个多边形具有相同点数的情况

有争议的代码

  if ( s.length !== e.length ){
    arL = Math.max(s.length,e.length);
    if ( arL === e.length) { sm = s; lg = e; } else { sm = e; lg = s; }
    sml = sm.length;

    smp = S.cP('M'+sm.join('L')+'z'); len = smp.getTotalLength() / arL;
    for (var i=0; i<arL; i++){
      tl = smp.getPointAtLength(len*i);
      cs = S.gCP(len,tl,sm);
      nsm.push( [ cs[0], cs[1] ] );
    }

    if (arL === e.length) { e1 = lg; s1 = nsm; } else { s1 = lg; e1 = nsm; }
  } else { // here we know the paths have same number of points
    s1 = s; e1 = e;
  }
if(s.length!==e.length){
arL=数学最大值(s.长度,e.长度);
如果(arL==e.length){sm=s;lg=e;}其他{sm=e;lg=s;}
sml=sm长度;
smp=S.cP('M'+sm.join('L')+'z');len=smp.getTotalLength()/arL;
对于(var i=0;i.

最新版本,该插件无法处理两个多边形具有相同点数的情况

有争议的代码

  if ( s.length !== e.length ){
    arL = Math.max(s.length,e.length);
    if ( arL === e.length) { sm = s; lg = e; } else { sm = e; lg = s; }
    sml = sm.length;

    smp = S.cP('M'+sm.join('L')+'z'); len = smp.getTotalLength() / arL;
    for (var i=0; i<arL; i++){
      tl = smp.getPointAtLength(len*i);
      cs = S.gCP(len,tl,sm);
      nsm.push( [ cs[0], cs[1] ] );
    }

    if (arL === e.length) { e1 = lg; s1 = nsm; } else { s1 = lg; e1 = nsm; }
  } else { // here we know the paths have same number of points
    s1 = s; e1 = e;
  }
if(s.length!==e.length){
arL=数学最大值(s.长度,e.长度);
如果(arL==e.length){sm=s;lg=e;}其他{sm=e;lg=s;}
sml=sm长度;
smp=S.cP('M'+sm.join('L')+'z');len=smp.getTotalLength()/arL;

对于(var i=0;i.

我在代码笔上看到变形。我在代码笔上看到变形。