1

I'm trying to implement zoom feature which not only zooms on the background image but also displays the FabricJS objects (Triangle and Circle)present on the canvas.

Currently what I have achieved is the magnified image displays correctly but I also want to display the objects present on the canvas to be displayed within the lens and to have the ability to click on them.

I understand that the background is only being cloned via fabric.util.object.clone and then passed to the 'lens' where it is then sent to 'clipTo' and displayed as a magnifying glass.

But how do clone all the objects and feed it to the lens ? not just the background image.

I have attached a fiddle here of my progress : https://jsfiddle.net/7m3otzq0/9/

The desired effect is to have something similar to how the library AnythingZoomer2 operates I would much prefer to solely use FabricJs as it's a amazing library https://css-tricks.com/examples/AnythingZoomer/index.php#?id=568

JimDigiJim
  • 21
  • 3

0 Answers0