diff --git a/routes/scenes/scene_edit_view.py b/routes/scenes/scene_edit_view.py index d4276a37..7ef00f2c 100644 --- a/routes/scenes/scene_edit_view.py +++ b/routes/scenes/scene_edit_view.py @@ -21,6 +21,24 @@ def render_scene_edit(slug, screen_id, game): objects = screens.list_scene_objects(slug, screen_id) for o in objects: o["rendered_html"] = screens.render_scene_object(o) + + # "Monde" (voir static/js/play/personnage-controller.js:: + # forgeUpdateSceneWorldSize, même principe côté serveur) : un "fond" + # posé à sa taille RÉELLE (souvent plus grande que la scène, voir + # add_scene_object.py) rend visible/joignable, dans CET éditeur, tout + # ce qui dépasse la scène nominale plutôt que de le rogner (le + # glisser-déposer le permet déjà depuis le fix précédent — sans + # agrandir le canevas ici, cette partie restait invisible/injoignable + # à la souris). Le rectangle "🎥 Champ de la caméra" (voir + # templates/scene_edit.html) marque ensuite où s'arrête la scène + # nominale À L'INTÉRIEUR de ce monde plus grand. + world_width, world_height = screen["scene_width"], screen["scene_height"] + for o in objects: + if o["kind"] == "fond": + world_width = max(world_width, o["x"] + o["width"]) + world_height = max(world_height, o["y"] + o["height"]) + world_width, world_height = int(world_width), int(world_height) + selected_id = request.args.get("selected", type=int) personnage_data = None personnage_commands = None @@ -95,6 +113,7 @@ def render_scene_edit(slug, screen_id, game): return render_template( "scene_edit.html", game=game, screen=screen, all_screens=all_screens, + world_width=world_width, world_height=world_height, objects=objects, selected_id=selected_id, personnage_data=personnage_data, personnage_commands=personnage_commands or screens.DEFAULT_PERSONNAGE_COMMANDS, personnage_role=personnage_role or screens.DEFAULT_PERSONNAGE_ROLE, diff --git a/static/style.css b/static/style.css index c8ec72c7..8b0ced04 100644 --- a/static/style.css +++ b/static/style.css @@ -592,6 +592,16 @@ body.builderBody > main.content{ flex:1 1 auto; min-height:0; overflow:hidden; d position:relative; width:100%; height:100%; flex:1 1 auto; margin:0; background:#0b0d12; border-radius:8px; overflow:hidden; border:1px solid var(--border); } +/* "🎥 Champ de la caméra" (voir templates/scene_edit.html) : repère + visuel marquant, à l'intérieur d'un monde agrandi par un "fond" plus + grand que la scène, les limites RÉELLES de ce que la caméra montre en + jeu — jamais interactif (pointer-events:none), pour ne jamais gêner la + sélection/le glisser d'un objet dessous. */ +.sceneCameraFrame{ + position:absolute; left:0; top:0; border:2px dashed var(--accent); + box-shadow:0 0 0 2000px rgba(0,0,0,.45); + pointer-events:none; z-index:5; +} .canvasElement{ /* Pas d'overflow:hidden ici : une échelle (transform:scale) ou une animation posée sur cet élément (voir la Timeline d'animation) vit sur diff --git a/templates/scene_edit.html b/templates/scene_edit.html index 90aa00c9..270308d1 100644 --- a/templates/scene_edit.html +++ b/templates/scene_edit.html @@ -121,7 +121,20 @@