Comments (2)
Here is a simple example of implementing LineTool
from the react-paperjs-editor package: https://github.com/psychobolt/react-paperjs/blob/master/packages/react-paperjs-editor/src/components/LineTool/LineTool.component.js
We can create a Tool component that handles mouse/keyboard handlers
import { Tool } from '@psychobolt/react-paperjs';
export default ({ onMouseDown, onMouseDrag, onMouseUp, ...rest }) => (
<Tool
onMouseDown={onMouseDown}
onMouseDrag={onMouseDrag}
onMouseUp={onMouseUp}
{...rest}
/>
);
from react-paperjs.
Thanks for fast reply. Going to try this solution
Thanks again!
from react-paperjs.
Related Issues (20)
- Can I smooth a path? HOT 3
- Touch events HOT 1
- TypeError: mergeProps is not a function HOT 12
- CompoundPath HOT 3
- Error Can't resolve dependency HOT 4
- How do you use Paper.onFrame for animation? HOT 2
- Support for React 17 HOT 1
- Loading SVGs HOT 2
- Prop changes don't trigger component redraws HOT 6
- TypeError: Cannot read property 'alternate' of undefined [issue in react 17.0.2] HOT 2
- SSR and GatsbyJS and jsdom HOT 2
- Error in function getNearestMountedFiber HOT 2
- Extending PaperTypes HOT 1
- Issue in extending PaperRenderer HOT 3
- Does it work with react 18?
- Issue with Paper.js Polygon Tool in Mirador-Annotation Library
- NS_ERROR_FAILURE when unmounting a component with <PaperContainer canvasProps={{ resize: '' }} /> HOT 4
- Update react-paperjs-editor version
- Detected multiple renderers rendering the same context provider HOT 5
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 react-paperjs.