I implemented an image viewer component with interactive buttons for rotating, zooming in, and zooming out. Upon clicking a button, CSS transform
is applied to the image.
However, I encountered an issue where, when zooming the image, it cannot be scrolled all the way to the top or left corner. I attempted to resolve this by adding transform-origin: top left;
to the image, which fixed the zoom but caused rotation problems. How can I address this issue effectively?
The code for my implementation can be viewed here: https://codesandbox.io/s/delicate-star-eitj3s?file=/src/app/app.component.ts
EDIT:
transform-origin: top left;
successfully anchors the image to the top left corner, but I prefer to keep the image centered. Is there a way to fix the scrolling while maintaining the transformation origin at the center of the image?