fix: thread cropOrientation into StickerCanvas (was using device orientation)
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
StickerCanvas was being passed contextOrientation (the target device's orientation), so the final composited.jpg was always sized to the device's aspect — even when the user toggled the crop tool to a different orientation. A landscape crop on a portrait device would produce a 1600x960 cropped blob, then the StickerCanvas would re-render it into a 960x1600 frame, visibly stretching the image into portrait dimensions and saving it that way. UploadView now derives an effectiveOrientation that prefers the user's chosen crop orientation (uploadStore.cropOrientation) and falls back to the device's orientation only before the crop step has run. The StickerCanvas honors that. Also adds a temporary debug log in the upload controller to verify the cropOrientation form field is arriving and being persisted — recent uploads have NULL cropOrientation despite the frontend sending it, and this log will make the next upload's payload visible. Will remove once diagnosed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<StickerCanvas
|
||||
v-else-if="step === 'stickers' && uploadStore.croppedUrl"
|
||||
:cropped-url="uploadStore.croppedUrl"
|
||||
:orientation="contextOrientation"
|
||||
:orientation="effectiveOrientation"
|
||||
:stickers="uploadStore.stickers"
|
||||
class="upload-view__stage"
|
||||
@add-sticker="uploadStore.addSticker"
|
||||
@@ -124,6 +124,13 @@ const contextOrientation = computed<'landscape' | 'portrait'>(() =>
|
||||
contextDevice.value?.orientation ?? 'landscape'
|
||||
)
|
||||
|
||||
// Once the user picks a crop orientation it drives the rest of the flow
|
||||
// (StickerCanvas aspect, output blob dims). Falls back to the device's
|
||||
// orientation while the crop step hasn't been completed yet.
|
||||
const effectiveOrientation = computed<'landscape' | 'portrait'>(() =>
|
||||
uploadStore.cropOrientation ?? contextOrientation.value
|
||||
)
|
||||
|
||||
const contextDeviceName = computed(() => contextDevice.value?.name)
|
||||
|
||||
// ── Steps ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user