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

裁剪功能:先旋转素材,然后加入裁剪图形,完成后,裁剪图形位置和旋转都非编辑时的效果 #501

Open
momo2019 opened this issue Aug 2, 2024 · 0 comments

Comments

@momo2019
Copy link
Contributor

momo2019 commented Aug 2, 2024

需要修改SimpleClipImagePlugin.ts代码

shell.on('deselected', 中加入 clipPath.rotate((clipPath.angle || 0) - (activeObject.angle || 0));

shell.on('deselected', () => {
  if (clipPath instanceof fabric.Ellipse && shell instanceof fabric.Ellipse) {
    // .....
  }
  clipPath.rotate((clipPath.angle || 0) - (activeObject.angle || 0)); // 加入这行代码
  activeObject.set('dirty', true);
  this.canvas.remove(shell);
  this.canvas.requestRenderAll();
});

需要使用裁剪原本的旋转值和消除素材的旋转值带来的影响。

示例视频

output.mp4

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

1 participant