Skip to content
Snippets Groups Projects
Commit f4a32a1e authored by StaffEngineer's avatar StaffEngineer
Browse files

update

parent 6051e7d7
No related branches found
No related tags found
No related merge requests found
[target.wasm32-unknown-unknown]
runner = "wasm-server-runner"
\ No newline at end of file
/target
.idea
.vscode
velo.json
ichart.json
data
out
\ No newline at end of file
Cargo.lock 0 → 100644
This diff is collapsed.
......@@ -13,7 +13,7 @@ exclude = ["assets/*"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", rev = "1e73312", default-features = false, features = [
bevy = { version = "0.11", default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
"bevy_render",
......@@ -25,7 +25,7 @@ bevy = { git = "https://github.com/bevyengine/bevy", rev = "1e73312", default-fe
"png",
"x11",
] }
cosmic-text = { git = "https://github.com/pop-os/cosmic-text", rev = "79275d1" }
cosmic-text = { version = "0.9" }
image = "0.24.6"
sys-locale = "0.3.0"
......@@ -33,12 +33,11 @@ sys-locale = "0.3.0"
arboard = "3.2.0"
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", rev = "1e73312", default-features = false, features = [ "webgl2" ] }
bevy = { version = "0.11", default-features = false, features = [ "webgl2" ] }
js-sys = "0.3.61"
[dev-dependencies]
insta = "1.29.0"
bevy_pancam = { git = "https://github.com/StaffEngineer/bevy_pancam", rev = "7154e90" }
[[example]]
name = "basic_button"
......
bevy_cosmic_edit.png

121 KiB | W: | H:

bevy_cosmic_edit.png

119 KiB | W: | H:

bevy_cosmic_edit.png
bevy_cosmic_edit.png
bevy_cosmic_edit.png
bevy_cosmic_edit.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -6,7 +6,6 @@ use bevy_cosmic_edit::{
CosmicEditSprite, CosmicFont, CosmicFontConfig, CosmicMetrics, CosmicNode, CosmicText,
CosmicTextPos,
};
use bevy_pancam::{PanCam, PanCamPlugin};
use cosmic_text::AttrsOwned;
fn setup(
......@@ -21,14 +20,7 @@ fn setup(
},
..default()
};
commands.spawn(camera_bundle).insert(PanCam {
grab_buttons: vec![MouseButton::Right],
enabled: true,
zoom_to_cursor: false,
min_scale: 1.,
max_scale: Some(3.),
..default()
});
commands.spawn(camera_bundle);
let cosmic_font_config = CosmicFontConfig {
fonts_dir_path: Some(Path::new("assets/fonts").into()),
font_bytes: None,
......@@ -71,7 +63,6 @@ fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(CosmicEditPlugin)
.add_plugins(PanCamPlugin::default())
.add_systems(Startup, setup)
.run();
}
......@@ -285,7 +285,7 @@ fn change_active_editor(
>,
) {
for (interaction, cosmic_edit, entity) in interaction_query.iter_mut() {
if let Interaction::Clicked = interaction {
if let Interaction::Pressed = interaction {
commands.insert_resource(ActiveEditor {
entity: Some(entity),
});
......
......@@ -6,7 +6,6 @@ use bevy_cosmic_edit::{
CosmicEditPlugin, CosmicEditSprite, CosmicFont, CosmicFontConfig, CosmicMetrics, CosmicNode,
CosmicText, CosmicTextPos,
};
use bevy_pancam::{PanCam, PanCamPlugin};
use cosmic_text::AttrsOwned;
#[derive(Component)]
......@@ -24,14 +23,7 @@ fn setup(
},
..default()
};
commands.spawn((camera_bundle, MainCamera)).insert(PanCam {
grab_buttons: vec![MouseButton::Right],
enabled: true,
zoom_to_cursor: false,
min_scale: 1.,
max_scale: Some(3.),
..default()
});
commands.spawn((camera_bundle, MainCamera));
let cosmic_font_config = CosmicFontConfig {
fonts_dir_path: Some(Path::new("assets/fonts").into()),
font_bytes: None,
......@@ -151,7 +143,6 @@ fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(CosmicEditPlugin)
.add_plugins(PanCamPlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, change_active_editor)
.run();
......
......@@ -20,7 +20,7 @@ cargo r --example basic_sprite
| bevy | bevy_cosmic_edit |
| ---- | ---------------- |
| 0.10 | 0.7 |
| 0.11 | 0.8 |
## License
......
---
on:
pull_request: null
name: pr checks
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-default:
name: Check default
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Deps
run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Check
run: cargo check --all-targets
check-wasm:
name: Check wasm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Check
run: cargo check --target wasm32-unknown-unknown --all-targets
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Deps
run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -A clippy::type_complexity -A clippy::too_many_arguments -D warnings
test-cosmic-edit:
name: Test cosmic-edit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Test bevy-markdown
run: cargo test -p bevy_cosmic_edit --lib
coverage:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: true
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment