Giter Club home page Giter Club logo

fabric-brush's Introduction

Fabric Brush - Canvas Brushes on Fabric.js

Fabric Brush is a collection of brushes built on an awesome canvas framework Fabric.js

Quickstart

crayon-brush ink-brush marker-brush spray-brush

Examples of use

Set the crayon brush as the free drawing brush

<script src="bower_components/fabric.js"></script>
<script src="bower_components/dist/fabric-brush.js"></script>

<canvas id="c"></canvas>
var canvas = new fabric.Canvas('c');

// Crayon Brush
canvas.freeDrawingBrush = new fabric.CrayonBrush(canvas, {
  width: 70,
  opacity: 0.6,
  color: "#ff0000"
});

// Ink Brush
// canvas.freeDrawingBrush = new fabric.InkBrush(canvas);

// Marker Brush
// canvas.freeDrawingBrush = new fabric.MarkerBrush(canvas);

// Spray Brush
// canvas.freeDrawingBrush = new fabric.SprayBrush(canvas);

Change color of the brush into red

canvas.freeDrawingBrush.changeColor("#ff0000");

Change opacity of the brush into 0.6

canvas.freeDrawingBrush.changeOpacity(0.6);

fabric-brush's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabric-brush's Issues

Not able to move created drawing

i am not able to move any drawing created with these brushes. i believe there is no object stored in fabric for these brushes as a result, fabric is not able to attach any handlers nor have any fabric manipulation.

save path

Awesome plugin, thanks for developing it!

It would be great if it could be integrated completly with fabric, as after leaving drawing mode the painting dissapears. It has to be with creating svg path, hasn't it?

Very beatiful indeed.

doesn't work with canvas.setZoom(x)

Hi

Great library. I have an issue so far: it doesn't work if you change canvas zoom level.
It also doesn't "drop" the shape on my canvas.

Any thought?

Draw brush strokes on lower-canvas?

I noticed that the brush strokes are drawn on the upper canvas. Thus making it impossible to layer with other items on the lower canvas.

The default fabric.js drawing brush draws on the lower canvas too.

Also, is it possible to select and move the strokes once they are drawn? Similar to how the default fabric.js brush works

is there a way to erase the brushes via EraserBrush?

Incredible library!! So good.

Was curious if folks have found a way to erase these brushes via the EraserBrush?

When I flip to the EraserBrush, it wholesale erases everything which makes me think that the line parts are being clumped into one group that is being deleted, rather than deleting its sub components.

Thank you for any insights you may have!

npm package

Would it be possible to create a npm package for this?
I need it so I can use the library with yarn and webpack.

Thanks!

use it in react

Hi,

how to use in react? I have done npm install fabric-brush

But then get error fabric.CrayonBrush is not a constructor.

greets

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.