Giter Club home page Giter Club logo

Comments (4)

CC4J avatar CC4J commented on September 15, 2024

帅哥,如果我用画笔画了两个不同图形,如何获取点击的是哪个图形?然后根据点击的图形上色?

fabric可以给画布监听点击事件,在事件回调里可以获取到当前选择的图形对象,拿到图形对象了自然就可以通过fabric提供的api去修改他的线框色与填充色。你可以去看一下 fabric的文档。如果你只想实现一个简单的画板功能,推荐你使用我封装后的 npm包 fabric-drawing-board :)

from fabric-drawing-board.

LanJingH avatar LanJingH commented on September 15, 2024

from fabric-drawing-board.

CC4J avatar CC4J commented on September 15, 2024

好的,感谢

------------------ 原始邮件 ------------------ 发件人: "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.

LanJingH avatar LanJingH commented on September 15, 2024

from fabric-drawing-board.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.