Im working on a project of building a editor, i am using the Fabric.js, but i don know how to make the canvas object auto align.
Is there any example of making canvas object auto align with another object like this?
image of snap example
auto snap example from other site
link here:
auto snap example site
相关问题
- character width calculation wrong with some font w
- fabric.js straight line and select on click
- change text once it is added on canvas
- fabricjs delete backgroundImage
- set Min and Max resize limits for fabric object
相关文章
- How to freedraw Circle in fabricjs using mouse?
- Saving JSON in canvas with fabric.js
- FabricJS image object clipTo shape object issue
- toSVG method not working on extended class with Fa
- Issue with object while restricting it to canvas b
- Can we add putImageData to fabric canvas instead o
- Fabric js: Increase font size instead of just scal
- Fabricjs intersectsWithObject returning false when
I was working on the same thing. This seems to be a pretty common feature request so I thought I'd share what I worked out. It could use some refinement. For instance, I've noticed if you scale the red box, the scale is not applied and it doesn't align right. However, I think it demonstrates the basic principal well and you can elaborate on it to fit your needs.
(Note: 8/1/2017: Working to place a more comprehensive code base on GitHub. (https://github.com/JerrodV/FabricObjectAlignment) More Details Soon!)
You can view the fiddle here
Html:
Javascript:
I hope you find this useful. Good Luck!