Answer the question
In order to leave comments, you need to log in
Organizing history back, forward when manipulating images on canvas (fabric.js)?
There is an implementation in js that performs rotate, crop images. There was a need to add actions history back, forward above the image.
The first thing that came to my mind was to implement this action through a buffer where the image from the canvas is saved on which some operation is performed (rotate, crop), and after the events (back or forward), the image is pulled out of the buffer and located on the canvas. The implementation was peeped from darkroom.js, namely the darkroom.history.js plugin.
But with such an implementation, an uncontrolled memory leak occurs. Since the buffer is an array of images. And images can be very large. Then each action (rotate, crop) is one new image in the buffer. And at a certain point, the browser will start to "slow down".
Question.
Is there a "smarter" history back, forward solution for large canvas images?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question