Comments (4)
帅哥,如果我用画笔画了两个不同图形,如何获取点击的是哪个图形?然后根据点击的图形上色?
fabric可以给画布监听点击事件,在事件回调里可以获取到当前选择的图形对象,拿到图形对象了自然就可以通过fabric提供的api去修改他的线框色与填充色。你可以去看一下 fabric的文档。如果你只想实现一个简单的画板功能,推荐你使用我封装后的 npm包 fabric-drawing-board :)
from fabric-drawing-board.
from fabric-drawing-board.
好的,感谢
…
------------------ 原始邮件 ------------------ 发件人: "CC4J/fabric-drawing-board" @.>; 发送时间: 2021年7月22日(星期四) 上午9:02 @.>; @.@.>; 主题: Re: [CC4J/fabric-drawing-board] 获取图形 (#2) 帅哥,如果我用画笔画了两个不同图形,如何获取点击的是哪个图形?然后根据点击的图形上色? fabric可以给画笔监听点击事件,在事件回调里可以获取到当前选择的图形对象,那道图形对象了自然就可以通过fabric提供的api去修改他的线框色与填充色。你可以去看一下 fabric的文档。如果你只想实现一个简单的画板功能,推荐你使用我封装后的 npm包 fabric-drawing-board :) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
不客气,如果觉得对你有些帮助,麻烦给个 star ,(●'◡'●)
from fabric-drawing-board.
from fabric-drawing-board.
Related Issues (4)
- 填充颜色 HOT 3
- 哥们,你有用 fabric 实现复杂图形和交互吗? HOT 3
- impact project other fabric objs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fabric-drawing-board.