Bouton "📐 Agrandir la caméra à la zone visible"
Build and deploy / test-python (push) Failing after 1m23s
Build and deploy / test-js (push) Successful in 54s
Build and deploy / build-and-push (push) Skipped
Build and deploy / deploy (push) Skipped

Fait de tout le "monde" affiché par l'éditeur (la taille réelle d'un
"fond" plus grand que la scène nominale, voir routes/scenes/
scene_edit_view.py::world_width/world_height) la scène/caméra ELLE-MÊME
— jusqu'ici scene_width/scene_height n'étaient fixées qu'à la création
de l'écran, jamais modifiables ensuite. Le bouton n'apparaît que quand
un fond dépasse encore la scène nominale (même condition que le repère
"🎥 Champ de la caméra"), affiche la taille cible, recharge la page une
fois appliqué. La caméra ne recadre alors plus rien en jeu (monde ==
scène == viewport, voir personnage-controller.js::forgeUpdateSceneCamera).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
william
2026-09-03 17:07:24 +02:00
co-authored by Claude Sonnet 5
parent 14ec76dddd
commit b9d3c46087
7 changed files with 100 additions and 3 deletions
+14
View File
@@ -20,6 +20,20 @@ function addSceneObject(kind, forgeCharacter, backgroundSlug) {
form.requestSubmit();
}
// "📐 Agrandir la caméra à la zone visible" (voir templates/scene_edit.html) :
// fait de tout le "monde" affiché par l'éditeur (voir world_width/
// world_height, routes/scenes/scene_edit_view.py — la taille réelle
// d'un "fond" plus grand que la scène nominale) la scène/caméra
// elle-même — recharge la page ensuite, SCENE_WIDTH/SCENE_HEIGHT et le
// cadre "🎥 Champ de la caméra" doivent tous deux refléter la nouvelle
// taille, plus simple qu'une mise à jour partielle en JS.
function expandCameraToWorld(width, height) {
fetch("/game/" + GAME_SLUG + "/screens/" + SCREEN_ID + "/scene-size", {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ width: width, height: height }),
}).then(function () { window.location.reload(); });
}
function saveSceneObjectGeometry(id, x, y, width, height) {
return fetch("/game/" + GAME_SLUG + "/scene-objects/" + id + "/geometry", {
method: 'POST', headers: { 'Content-Type': 'application/json' },