-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add shift + mouse scroll for zoom out and zoom in in preview app #1248
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
Conversation
df0509f to
d452679
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds shift + mouse scroll functionality to zoom in and out in the preview app's image viewer. The changes simplify the image controls by removing position tracking and introducing a more straightforward zoom control mechanism.
- Replaces complex pan-zoom event handling with direct wheel event handling
- Implements shift + scroll wheel zoom functionality with 0.1 step increments
- Uses event bus pattern for image reset functionality instead of direct prop passing
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| useImageControls.ts | Removes position tracking state and pan-zoom event handler, adds event bus for reset functionality |
| MediaImage.vue | Implements wheel event handler for shift+scroll zoom, replaces pan-zoom change events with direct zoom emission |
| App.vue | Updates component props to remove position tracking and use simplified zoom event handler |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| :alt="file.name" | ||
| :data-id="file.id" | ||
| class="max-w-full max-h-full pt-4 cursor-move object-contain" | ||
| :style="`transform: rotate(${currentImageRotation}deg)`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed anymore
| :src="file.url" | ||
| :alt="file.name" | ||
| :data-id="file.id" | ||
| class="max-w-full max-h-full pt-4 cursor-move object-contain" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cursor-move object-contain are obsolete
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
kulmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, nice one! 🤓 🕵️
Description
Related Issue
How Has This Been Tested?
Types of changes