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

【bug】group中的虚线如果有动画,将该group与外部的一条虚线交集,外部的虚线交集部分也会有动画 #305

Open
yyyyh opened this issue Dec 25, 2024 · 2 comments

Comments

@yyyyh
Copy link

yyyyh commented Dec 25, 2024

PixPin_2024-12-25_15-26-54
代码如下图
image

@leaferjs
Copy link
Owner

谢谢反馈,请提供一个可以直接运行复现的示例代码~

@yyyyh
Copy link
Author

yyyyh commented Dec 25, 2024

谢谢反馈,请提供一个可以直接运行复现的示例代码~

import { App, Group, Line } from 'leafer-editor'
import { Animate } from 'leafer-game';

const app = new App({
    view: window,
    // type:'draw',
    editor: {} // 会自动创建 editor实例、tree层、sky层
})

const line=new Line({
  points:[30,412,363,355],
  stroke: 'red',
  strokeWidth: 2,
  dashPattern: [20, 10],
  dashOffset: 0
})
const line1=new Line({
    points:[30,412,363,355],
    stroke: 'rgba(31, 103, 254, 0.5)',
    strokeWidth: 10,
})

const group = new Group({ editable: true })
group.add(line1)
group.add(line)


app.tree.add(group)

const animate= new Animate(
    line,
    { dashOffset: 150 }, // style keyframe
    {
      reverse: true,
      easing: 'linear',
      duration: 3,
      loop: true,
    }
  ); 


const line2=new Line({
    points:[130,512,463,355],
    stroke: 'red',
    strokeWidth: 2,
    dashPattern: [10, 10],
    editable: true
})

app.tree.add(line2)

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