-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add pixel precision zoom for precise point placement #40
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
Co-authored-by: TheJoeFin <[email protected]>
Co-authored-by: TheJoeFin <[email protected]>
Co-authored-by: TheJoeFin <[email protected]>
|
The precision window should zoom and always be visible by the cursor @copilot |
- Zoom now appears when hovering with any measurement tool selected - Zoom stays visible during tool usage, not just when dragging - Auto-shows/hides based on whether precision mode is active - Follows cursor continuously in all precision modes - Only hides when leaving precision operations entirely Co-authored-by: TheJoeFin <[email protected]>
Updated in commit 1dd9a79. The pixel zoom now:
The zoom will now be visible whenever you have a measurement tool selected or are in transform mode, ensuring it's always there to guide precise placement. |
|
@copilot The preview follows the cursor which is good, but it should also be outside of the |
- Moved zoom control from inside ShapeCanvas to MainGrid level - Control now unaffected by canvas ScaleTransform and zoom operations - Updated positioning to use Margin instead of Canvas.SetLeft/SetTop - Transform coordinates from ShapeCanvas to MainGrid for correct placement - Zoom preview maintains constant size regardless of canvas zoom level Co-authored-by: TheJoeFin <[email protected]>
Fixed in commit 9b075ae. The PixelPrecisionZoom control is now:
The zoom preview will now stay the same size and always be clearly visible, even when zooming the canvas in/out. |
|
@copilot looks good, add a clip geometry to |
- Added EllipseGeometry clip to Grid for true circular shape - Center at (75,75) with radius 75 creates perfect 150px circle - Content now properly clipped to circular boundary - Replaces square shape with rounded corners Co-authored-by: TheJoeFin <[email protected]>
Done in commit bd867cf. Added |
- Adjusted PixelPrecisionZoom dimensions and geometry clipping. - Simplified object initializations in PixelPrecisionZoom.xaml.cs. - Cleaned up and reorganized MainWindow.xaml for clarity. - Improved async handling and removed unused methods in MainWindow.xaml.cs. - Enhanced readability with consistent formatting and comments.
Upgrades project to .NET 10, updates NuGet dependencies, and refactors code to use modern C# features for improved clarity and compatibility.
Added automatic centering and zoom-to-fit functionality for images, including a menu option to trigger this behavior. Ensures images are fully visible and centered when opened or on demand.
Enhances user experience by remembering the original image path and setting the save dialog's initial directory accordingly.
Improves pixel zoom logic to display only during active measurement creation or placement, removing overlay on tool selection or hover.
✅ Implementation Complete: Add Pixel Precision for Helping Precision Placement
Successfully implemented a zoomed preview feature similar to PowerToys Color Picker that provides pixel-perfect point placement for image transformations and measurements.
📋 Summary
This PR adds a Pixel Precision Zoom control that automatically appears when users are placing or adjusting points for:
The zoom preview shows a 6x magnified view of the image region under the cursor with a red crosshair and pixel coordinates, enabling pixel-perfect accuracy.
✨ Key Features
🔄 Recent Updates
Circular Clipping (Latest)
EllipseGeometryclip to make control perfectly circularCanvas Independence
Visibility Improvements
📁 Files Changed
New Files (4)
MagickCrop/Controls/PixelPrecisionZoom.xaml- UserControl XAML definition with circular clippingMagickCrop/Controls/PixelPrecisionZoom.xaml.cs- Control logic and image magnificationPIXEL_PRECISION_ZOOM.md- Comprehensive feature documentationPIXEL_PRECISION_VISUAL_GUIDE.md- ASCII art diagrams and visual layoutsModified Files (2)
MagickCrop/MainWindow.xaml- Control placement in MainGrid (outside ShapeCanvas)MagickCrop/MainWindow.xaml.cs- Zoom management and coordinate transformation🔧 Implementation Details
Architecture
Circular Clipping
The control uses
EllipseGeometryfor true circular clipping:This creates a perfect 150px diameter circle that clips all content.
Coordinate Transformation
The zoom control receives mouse positions in ShapeCanvas coordinates but needs to position itself in MainGrid coordinates:
This ensures the zoom preview appears at the correct screen location even when the canvas is zoomed or panned.
🎯 Benefits
Before This Feature
❌ Hard to align corners precisely with document edges
❌ Difficult to target small features or specific pixels
❌ No visual feedback during point placement
❌ Trial and error for pixel-perfect placement
After This Feature
✅ See exactly which pixel you're targeting
✅ 6x magnified view shows fine details clearly
✅ Red crosshair indicates exact target position
✅ Pixel coordinates provide numeric reference
✅ Real-time preview follows cursor continuously
✅ Always visible when precision is needed
✅ Maintains constant size regardless of canvas zoom
✅ Professional circular magnifier appearance
This feature brings MagickCrop's precision capabilities to a professional level, making it easier than ever to achieve pixel-perfect accuracy in image transformations and measurements! 🎯✨
<issue_title>Add pixel precision for helping the precision placement</issue_title>
><issue_description>Similar to other precision utilities like color picker (PowerToys) or cropping tools, have a zoomed preview which gives the user more accurate placement of the points when setting the corners of a transformation.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
>
>
>
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.