this didnt work on desktop. manually flip the viewfinder feed on the canvas rendering over the middle line (and dont have any buttons to toggle it on or off... we ALWAYS want to have the viewfinder selfie flipped vertically)
You're right, let's simplify this by always mirroring the viewfinder feed horizontally (not vertically) regardless of device or camera mode. This will make the experience consistent across all devices.
I've simplified the mirroring implementation to ensure it works consistently across all devices:
Always Mirror the Viewfinder:
scale-x-[-1] class to the video element in the Camera component, which horizontally flips the feed.Consistent Image Capture:
context.translate and context.scale) to properly flip the image.Removed Conditional Logic:
facingMode for mirroring, making the behavior consistent.These changes ensure that:
This implementation provides a more natural and intuitive experience for users, similar to how most camera apps work, where the preview shows a mirrored view but captures the actual image.
the viewfinder correctly flips the image horizontally now! but on release, the flipped image is not being displayed exactly like the realtime selfie viewfinder
be sure that we also save and render the flipped image consistently on canvas
You're right - we need to ensure consistency between what the user sees in the viewfinder and what gets saved and displayed on the canvas. Let's fix this to make sure the flipped image is saved and rendered exactly as it appears in the viewfinder.
I've made changes to ensure that the flipped image is saved and rendered consistently on the canvas, exactly as it appears in the viewfinder:
Updated the Image Capture Process:
endDrag function in the Canvas component to capture the image exactly as it appears in the viewfinder.Simplified the PastedImage Component:
Added a Mirrored Property to the Image Type:
mirrored property.These changes ensure that:
This creates a consistent experience where what you see is what you get - the image on the canvas will look exactly like what was shown in the viewfinder during capture.
this is close! be sure that when we save what is displayed on the canvas, we are consistently handling the vertical crop too
right now, when we save tall images they are being smushed and distorted when saved to the canvas. we want them to be consistent with dragging the viewfinder