diff --git a/static/js/scenes/scene-editor.js b/static/js/scenes/scene-editor.js
index 9fe057dc..3110058d 100644
--- a/static/js/scenes/scene-editor.js
+++ b/static/js/scenes/scene-editor.js
@@ -20,14 +20,16 @@ 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) {
+// Taille de la camĂ©ra (voir "đź Jeu 2D" en haut de templates/
+// scene_edit.html) â TOUJOURS modifiable ici, directement en pixels
+// (demande explicite : "l'écran de l'éditeur a une taille fixe, la
+// camĂ©ra a la mĂȘme taille, c'est tout") : recharge la page une fois
+// appliquĂ©, SCENE_WIDTH/SCENE_HEIGHT et le cadre "đ„ Champ de la camĂ©ra"
+// éventuel doivent tous deux refléter la nouvelle taille, plus simple
+// qu'une mise Ă jour partielle en JS.
+function applyCameraSize() {
+ var wEl = document.getElementById('scene-camera-w'), hEl = document.getElementById('scene-camera-h');
+ var width = parseInt(wEl.value, 10) || 1, height = parseInt(hEl.value, 10) || 1;
fetch("/game/" + GAME_SLUG + "/screens/" + SCREEN_ID + "/scene-size", {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ width: width, height: height }),
diff --git a/templates/scene_edit.html b/templates/scene_edit.html
index fefc770c..c5d51b7e 100644
--- a/templates/scene_edit.html
+++ b/templates/scene_edit.html
@@ -30,15 +30,21 @@
demande de l'utilisateur, en prévision d'un éditeur dédié aux scÚnes
2D (collision/périmÚtre -> action), pas encore construit. -->
- đź Jeu 2D â scĂšne Ă taille fixe ({{ screen.scene_width }}Ă{{ screen.scene_height }} px).
- {% if world_width > screen.scene_width or world_height > screen.scene_height %}
-
-
- {% endif %}
+ đź Jeu 2D â scĂšne Ă taille fixe.
+
+
+
+
+
diff --git a/tests/test_scene_edit_view.py b/tests/test_scene_edit_view.py
index b653fd93..8a1e0781 100644
--- a/tests/test_scene_edit_view.py
+++ b/tests/test_scene_edit_view.py
@@ -214,6 +214,12 @@ def test_scene_edit_view_world_matches_scene_when_no_oversized_fond(client, tmp_
html = client.get(f"/game/{slug}/screens/{screen_id}/edit").get_data(as_text=True)
assert 'id="canvas" style="width:960px; height:540px;' in html
assert "sceneCameraFrame" not in html
+ # "CamĂ©ra (px)" : TOUJOURS modifiable, mĂȘme sans fond qui dĂ©passe
+ # (demande explicite : "l'écran de l'éditeur a une taille fixe, la
+ # camĂ©ra a la mĂȘme taille, c'est tout" â un rĂ©glage direct, pas
+ # seulement suggéré automatiquement).
+ assert 'id="scene-camera-w" class="input is-small" style="width:80px;" min="1" value="960"' in html
+ assert 'id="scene-camera-h" class="input is-small" style="width:80px;" min="1" value="540"' in html
def test_scene_edit_view_expands_world_for_an_oversized_fond(client, tmp_game_slug_cleanup):
@@ -242,9 +248,9 @@ def test_scene_edit_view_world_bounds_are_used_for_drag_clamping(client, tmp_gam
def test_set_scene_size_updates_screen_dimensions(tmp_game_slug_cleanup):
- """"đ Agrandir la camĂ©ra Ă la zone visible" (voir templates/
- scene_edit.html) : fait du "monde" affiché la scÚne/caméra
- elle-mĂȘme â jusqu'ici fixĂ©e Ă la crĂ©ation et jamais modifiable."""
+ """"Caméra (px)" (voir templates/scene_edit.html) : jusqu'ici
+ scene_width/scene_height n'étaient fixées qu'à la création de
+ l'écran, jamais modifiables ensuite."""
slug = tmp_game_slug_cleanup(db.create_game("pytest_scene_size"))
screen_id = screens.create_screen(slug, "ScĂšne 1", kind="jeu_2d")
screens.set_scene_size(slug, screen_id, 1920, 1080)
@@ -262,9 +268,12 @@ def test_screen_set_scene_size_route_persists_and_reflects_in_editor(client, tmp
assert resp.get_json() == {"ok": True}
html = client.get(f"/game/{slug}/screens/{screen_id}/edit").get_data(as_text=True)
assert 'id="canvas" style="width:1920px; height:1080px;' in html
- # La scÚne nominale == le monde désormais -> plus de repÚre caméra ni de bouton.
+ # La scÚne nominale == le monde désormais -> plus de repÚre caméra.
assert "sceneCameraFrame" not in html
- assert "Agrandir la caméra" not in html
+ # Les champs "Caméra (px)" restent TOUJOURS visibles (pas conditionnels),
+ # pré-remplis avec la nouvelle taille.
+ assert 'id="scene-camera-w" class="input is-small" style="width:80px;" min="1" value="1920"' in html
+ assert 'id="scene-camera-h" class="input is-small" style="width:80px;" min="1" value="1080"' in html
def test_screen_set_scene_size_route_rejects_invalid_dimensions(client, tmp_game_slug_cleanup):