Questions tagged [fabricjs2]

For questions about programming problems with version 2 of the Fabric.js framework. Use [fabricjs] if your question isn't version dependent.

This tags refers to the version 2 of Fabric.js
Fabric.js makes easy to work with elements.

Have a look at the 2.0 changelog for breaking changes and extra features from previous version,
or visit the for more tagged questions.

Fabric.js also supports subclassing, touch devices and Node.js

Additional Resources:

122 questions
1
vote
0 answers

FabricJs 2.1 and Angular 5.2

I have been using FabricJS 2.0 rc-3 and Angular 5.0.3 and they worked well together, but now I'm starting a new project and used the current latest stable FabricJS 2.1 and Angular 5.2.7 and they do not work. This is how I imported Fabric and worked…
1
vote
0 answers

fabrcjs v2 selection breaking changes

In the list of breaking changes for fabricjs v2, one of the entries says: "Click and drag on the canvas creates a rectangular selection. All the bounding boxes intersecting with this rectangle will be selected on mouse up creating a multi…
RKMNRGRT
  • 33
  • 4
0
votes
0 answers

Rotate scaled objects in FabricJS

I have a fabricjs canvas with some objects. I have a zoom function that scales the objects and canvas in and out/up and down (fabricjs scales the objects, and I manually scale the canvas) when objects are at scale 1 they rotate just fine, but when…
0
votes
0 answers

intersectsWithObject between objects in and not in activeSelectio

intersectsWithObject between objects in and not in activeSelection I am using fabricJS 4.3.1. When an object is part of an active selection of multiple objects, the this.intesectsWithObject no longer returns true for objects it is "intersecting"…
Joe Win
  • 1
  • 1
0
votes
0 answers

How can I implement image crop and clipPath with fabricjs

`I want to make a trim and clip path functionality with fabric js, basically the same thing happens to me as in this case https://stackoverflow.com/questions/75260621/image-cropping-and-masking-using-fabricjs/76327881 I would greatly appreciate any…
0
votes
0 answers

I want to do infinite resize and infinite repeat backgroundImage on canvas with fabric.js

Here is my code where it is working zoom but the background image is not repeat on zoom with fabric. Here I tried repeat with pattern but still not repeat the background. how can I achieve this when zoom perform with infinite on canvas and then…
Dhaval Bhavsar
  • 495
  • 5
  • 17
0
votes
0 answers

How to add properties to a rect when scaling on fabricjs when importing JSON?

I have a function where the rect, on scaling, cannot pass from the 20px limits on width or height, and its working fine. document.getElementById("rectanglebtn").onclick = () => { var rect = new fabric.Rect({ fill: fillcolor, width: 100, …
0
votes
0 answers

undo & redo actions fabric js on loaded canvas

I've achieved with other's solutions to undo & redo functions on a fabric js canvas (change size of rectangle and set it as previously, move and move it as previously...). I have a project where I can import different prebuilded canvas, which are…
0
votes
0 answers

How to set minimum width/height on a fabricjs object?

I've been seen a lot of questions and answers about this but i didn't find anything doing the exact same thing as questioned. I need a fabricjs object to can be transformed freely anytime but also set a minimum width and height (for example 50px)…
0
votes
0 answers

FabricJS - how to get current canvas object in loadFromJSON callback?

I have several canvases and i need to block all object selection after loading them. The problem is that loadFromJSON function is async and when it fires callback i variable is already last one so selection is being disabled only for last…
user2455079
  • 420
  • 4
  • 16
0
votes
1 answer

Export canvas on fabric.js to an image

I'm using fabric.js to make a draw and export the canvas to a .png without background. The thing is that I've been searching and this is the only thing that, in a way, makes sense to me: document.getElementById("downloadbtn").onclick =…
0
votes
0 answers

Original Image from Canvas using Fabricjs

I am creating an app in which we need to upload the image to the canvas and finally I need the original image from the canvas with the same height, width and size of the image I uploaded. Right now I can extract that image from the canvas but its…
0
votes
0 answers

Converting "Arc" shape code to Fabric.js 521

I'm trying to convert our legacy code, that uses Fabric.js 4.0.0-beta.6, to the latest version but encountered a problem I can't seem to resolve. I'm trying to draw an arc shape which is going fine in version 4 but doesn't work in later…
roapp
  • 530
  • 6
  • 17
0
votes
1 answer

canvas.loadFromJSON() showing text bulry for google fonts

I am facing this problem for a long time. I am generating the flipbook from the canvas using Fabricjs. I am changing the text content color and fonts on the fly. Everything is working fine but when I am trying to use google fonts so in that case…
kantsverma
  • 606
  • 1
  • 11
  • 31
0
votes
1 answer

How can I draw a right triangle with fabric js?

function normalTriangle() { return new fabric.Triangle({ transparentCorners: false, objectCaching: false, shapeType: 'normalTriangle' }) } canvas = new fabric.Canvas(canvasElement, { selection: true …
1 2 3
8 9