Skip to content

Commit

Permalink
Merge pull request #36 from hyoi/BUGFIX_bad_rendering_in_mobile_browsers
Browse files Browse the repository at this point in the history
Bugfix #35: bad rendering in mobile browsers
  • Loading branch information
hyoi authored Aug 26, 2024
2 parents 60682a5 + b09f83f commit 201d0b2
Show file tree
Hide file tree
Showing 4 changed files with 1,148 additions and 1,142 deletions.
12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ path = "crates/tigtag/src/main.rs"
[features]
sprite_off = [] # cargo run --features sprite_off

[profile.release-wasm]
inherits = "release"
opt-level = "s"
debug = "none"
#split-debuginfo = "packed" #platform-specific
strip = "symbols"
#lto = true #モバイルブラウザで表示されない不具合の対策
codegen-units = 1
panic = "abort"

################################################################################

[workspace]
resolver = "2"

[workspace.package]
version = "0.14.1"
version = "0.14.2"
edition = "2021"

[workspace.dependencies]
Expand Down
36 changes: 18 additions & 18 deletions crates/tigtag/src/template/misc/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ pub fn spawn_camera_2d( mut cmds: Commands )
{ //タイトルバーWクリックや最大化ボタンによるウィンドウ最大化、および
//WASMでCanvasへのfit(最大化)を設定した場合に表示が著しく崩れることがある。
//それを緩和するためカメラにviewportを設定しておく
let zero = UVec2::new( 0, 0 );
let size = Vec2::new( SCREEN_PIXELS_WIDTH, SCREEN_PIXELS_HEIGHT );
let viewport = Some
( bevy::render::camera::Viewport
{ physical_position: zero,
physical_size : size.as_uvec2(),
..default()
}
);
// let zero = UVec2::new( 0, 0 );
// let size = Vec2::new( SCREEN_PIXELS_WIDTH, SCREEN_PIXELS_HEIGHT );
// let viewport = Some
// ( bevy::render::camera::Viewport
// { physical_position: zero,
// physical_size : size.as_uvec2(),
// ..default()
// }
// );

cmds.spawn( ( Camera2dBundle::default(), CameraDefault2d ) )
.insert( Camera
Expand All @@ -39,15 +39,15 @@ pub fn spawn_camera_3d( mut cmds: Commands )
{ //タイトルバーWクリックや最大化ボタンによるウィンドウ最大化、および
//WASMでCanvasへのfit(最大化)を設定した場合に表示が著しく崩れることがある。
//それを緩和するためカメラにviewportを設定しておく
let zero = UVec2::new( 0, 0 );
let size = Vec2::new( SCREEN_PIXELS_WIDTH, SCREEN_PIXELS_HEIGHT );
let viewport = Some
( bevy::render::camera::Viewport
{ physical_position: zero,
physical_size : size.as_uvec2(),
..default()
}
);
// let zero = UVec2::new( 0, 0 );
// let size = Vec2::new( SCREEN_PIXELS_WIDTH, SCREEN_PIXELS_HEIGHT );
// let viewport = Some
// ( bevy::render::camera::Viewport
// { physical_position: zero,
// physical_size : size.as_uvec2(),
// ..default()
// }
// );

//3Dカメラの座標を初期化する(オービットカメラ)
let vec3 = Orbit::default().to_vec3();
Expand Down
Loading

0 comments on commit 201d0b2

Please sign in to comment.