-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rotate Image? #18
Comments
hey @MRoseBCC
and use CSS |
Hi @cotton123236 , I really like your work (thank you), but I had to add the options rotate on a short time (seems easier than to find another lib).
In zoom(zoomRatio, pointer) {}
In dragMove
It may needs to be perfected but I hope it helps someone. |
Hi @ESPRI-Paula , Thanks for your like! Actually, I'm working on new library Zoomist v2. I'll take your advice in v2. |
Hello Cotton, Any idea when v2 gonna be released? And thank you for creating this great viewer 👍 |
Hey, @R-W-C The works on v2 has come to the end. |
I opened a Pull Request to integrate rotation functionality, but looks like you might already have implemented it for the next version! |
@trehoffman Thanks for your help! I already figured out a better solution to rotate image and implemented it for the next version. I'll publish it ASAP! |
Hi @R-W-C @trehoffman @ESPRI-Paula , |
@cotton123236 I tried out the new branch, but the rotate button is disabled initially. It becomes enabled when I zoom, but clicking it only resets the image back to inital zoom state and doesn't rotate the image. |
Hi @trehoffman , But you can custom your own rotate button with version 2.X, for example: <!-- html -->
<div class="zoomist-container">
<div class="zoomist-wrapper">
<div class="zoomist-image">
<img class="my-image" src="..." />
</div>
</div>
</div>
<button class="rotate-btn" role="button">ROTATE</button>
<!-- js -->
<script>
let imageRotation = 0
const image = document.querySelector('.my-image')
const rotateBtn = document.querySelector('.rotate-btn')
rotateBtn.addEventListener('click', () => {
imageRotation += (imageRotation >= 270 ? - 270 : 90)
image.style.setProperty('transform', `rotate(${imageRotation}deg)`)
})
</script> Hope this comment helps you! |
I'm using zoomist with images that are being pulled in via an API, so they're of a set width, height, orientation, etc. It's working great but one thing that would be beneficial for my project is if the images were landscape as opposed to their original portrait. I have naturally tried doing this with CSS but Zoomist hates it because it's accounting for the image being portrait as opposed to landscape so it won't fit well in it's container and it sends the panning of the image off as well.
In short, is there any way to rotate an image in Zoomist which keeps the pan and zoom functionality intact?
The text was updated successfully, but these errors were encountered: