Fabric.js: Bounding box shape for image

Created on 10 Jul 2017  路  5Comments  路  Source: fabricjs/fabric.js

I found 2 demos bellow. It's about move image in a box. It's kind of looking like a mask.

demo 1: Using rect to create bounding box.
http://jsfiddle.net/32Acb/87/

demo 2: Using polygon to create bounding box.
http://jsfiddle.net/ZxYCP/198/

I tried to change the shape for bounding boxes, but doesn't work. For example, if I change the shape from rect to circle for demo1, the bounding box is still rect.

Any idea?

Btw, I've been trying to do image transform in a mask on fabric js for weeks. This is the latest chance I can try, I really don't want to give up fabric js. Please help, thanks.

All 5 comments

what is the final goal?

The final goal is to design svg on editor.

image

sure but did you not open a stack overflow question for this? you opened a similar question and i closed it asking you to move on stack overflow.

ok i missed the link. found the question

I answered there with one of the many possible solutions. Please keep the conversation there. Improve the question with an explanation of what are you trying to accomplish, is vague, the title is bad, they will likely close your question.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

keanass picture keanass  路  5Comments

semiadam picture semiadam  路  3Comments

bevacqua picture bevacqua  路  4Comments

eddieyangtx picture eddieyangtx  路  5Comments

mlev picture mlev  路  3Comments