I am working with Fabric.js and need to implement inline image cropping using control dots (mt, mb, mr, ml). My goal is to achieve the following behavior:
Horizontal Resizing (mr, ml) → Instead of stretching, the image should zoom and crop from the top and bottom.
Vertical Resizing (mt, mb) → Instead of stretching, the image should zoom and crop from the left and right.
Essentially, the image should scale while maintaining aspect ratio, and cropping should be applied dynamically as the controls are adjusted.
How can I achieve this effect using Fabric.js? Any guidance or examples would be appreciated!
enter image description here