desktop: Add --letterbox option

This commit is contained in:
nosamu 2023-02-09 22:39:46 -06:00 committed by Bale
parent e7612f571d
commit 1a65a0942c
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
///
/// When letterboxed, black bars will be rendered around the exterior
/// margins of the content.
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Collect, Serialize, Deserialize)]
#[collect(require_static)]
#[serde(rename = "letterbox")]

View File

@ -122,6 +122,10 @@ struct Opt {
#[clap(long, default_value = "streaming")]
load_behavior: LoadBehavior,
/// Specify how Ruffle should handle areas outside the movie stage.
#[clap(long, default_value = "on")]
letterbox: Letterbox,
/// Spoofs the root SWF URL provided to ActionScript.
#[clap(long, value_parser)]
spoof_url: Option<Url>,
@ -296,7 +300,7 @@ impl App {
.with_storage(storage::DiskStorageBackend::new()?)
.with_ui(ui::DesktopUiBackend::new(window.clone())?)
.with_autoplay(true)
.with_letterbox(Letterbox::On)
.with_letterbox(opt.letterbox)
.with_warn_on_unsupported_content(!opt.dont_warn_on_unsupported_content)
.with_fullscreen(opt.fullscreen)
.with_load_behavior(opt.load_behavior)