fix(layout): fit the screen box to the crop, and honour it without a camera - #149
Closed
EtienneLescot wants to merge 0 commit into
Closed
fix(layout): fit the screen box to the crop, and honour it without a camera#149EtienneLescot wants to merge 0 commit into
EtienneLescot wants to merge 0 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
EtienneLescot
force-pushed
the
claude/crop-aspect-regression
branch
from
July 24, 2026 13:36
04073bf to
5c741e7
Compare
EtienneLescot
force-pushed
the
claude/crop-aspect-regression
branch
from
July 24, 2026 14:26
5c741e7 to
ed97fce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Le symptôme
Un clip recadré s'affiche étiré. Crop
30% × 89%d'une source 16:9 → l'image est écrasée horizontalement d'environ 2,8×.Diagnostic
Ni un ancien patch resté en place, ni un défaut du compositeur, ni un comportement Electron. Deux défauts indépendants, un de chaque côté du contrat de scène.
1. L'app envoie un rect écran dont le ratio ignore le crop
buildSceneDescriptionrésolvait le layout avecscreenSize: { width: 1920, height: 1080 }, en dur.C'était sans conséquence tant que seul
webcamRectétait consommé de ce layout : la boîte écran ne servait qu'à borner le slot caméra, sa forme exacte n'avait aucune importance. Elle est devenue porteuse quandce3acf95a commencé à envoyerscreenRectau natif comme un rect consommé tel quel, documenté « already at the crop's aspect ratio ». Il ne l'était pas.Les deux autres consommateurs de
computeCompositeLayoutpassaient déjà la taille recadrée :screenSizePreviewCanvascroppedScreenSize— avec un commentaire décrivant précisément ce mode de panneframeRenderer(export WebCodecs)croppedVideoWidth/HeightsceneDescription(natif){1920, 1080}en dur ❌Le builder natif était le seul à diverger. Il dérive désormais la même valeur des dimensions réelles du premier clip visible — la convention « unités sources du premier asset visible » que son propre commentaire revendiquait déjà.
2. Le natif n'honorait le rect écran que si un rect caméra l'accompagnait
Le bras de
matchqui appliquaitapp_screen_rectétait indexé surapp_webcam_rect == Some. Sans caméra, l'écran gardait le rect plein cadre du preset — pendant quefit_screensautait quand même son propre fit au ratio du crop, puisqu'unapp_screen_rectétait bien présent.Un clip recadré sans caméra était donc étiré sans qu'aucune des deux voies ne le rattrape. Écran et caméra sont deux calques indépendants ; chaque rect résolu par l'app remplace maintenant sa contrepartie du preset de son côté.
Alignement avec la refonte ratio
Même principe que
cover_crop_uv: l'invariant ne doit pas vivre chez l'appelant. Ici il y était deux fois — une hypothèse sur le ratio du rect côté TS, un couplage à la présence de la caméra côté Rust. Aucun cas particulier ajouté ; le n°2 retire une condition au lieu d'en ajouter une.Non-régression
Non couvert
Vérifié par rendu golden hors-app (même chemin que l'export). Le rendu dans l'éditeur reste à confirmer visuellement — je peux redéployer le
.nodeet relancer l'app si tu veux boucler dessus.