diff --git a/Cargo.lock b/Cargo.lock index d84791c..6e44cc8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2135,7 +2135,7 @@ dependencies = [ [[package]] name = "ratframe" -version = "1.1.1" +version = "1.1.4" dependencies = [ "argh", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 79756ce..f4257d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ratframe" -version = "1.1.1" +version = "1.1.4" authors = ["gold-silver-copper"] edition = "2021" include = ["LICENSE-APACHE", "LICENSE-MIT", "**/*.rs", "Cargo.toml"] @@ -41,7 +41,7 @@ eframe = { version = "0.27.2", default-features = false, features = [ "persistence", # Enable restoring app state when restarting the app. ] , optional= true} -web-time = {version = "1" , optional = true} +web-time = {version = "1" } # native: @@ -54,7 +54,7 @@ wasm-bindgen-futures = "0.4" log = "0.4" [features] -default = ["eframe", "web-time"] +default = ["eframe"] [profile.release] opt-level = 2 # fast and small wasm diff --git a/bevy_example/Cargo.toml b/bevy_example/Cargo.toml index 66c7b3a..e87dc9a 100644 --- a/bevy_example/Cargo.toml +++ b/bevy_example/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" bevy = "0.13.2" bevy_egui = "0.27.0" ratatui = { version = "0.26.2", default-features = false } -ratframe = {version = "1.0.13", default-features = false} +ratframe = {version = "1.1.3", default-features = false} #disable defaults features for rat frame if you do not want to import eframe diff --git a/macroquad_example/Cargo.toml b/macroquad_example/Cargo.toml index 4f62f1b..1ea5474 100644 --- a/macroquad_example/Cargo.toml +++ b/macroquad_example/Cargo.toml @@ -12,5 +12,5 @@ macroquad = "0.4.5" egui-macroquad = { git = 'https://github.com/gold-silver-copper/egui-macroquad.git', branch="master" } ratatui = { version = "0.26.2", default-features = false } -ratframe = {version = "1.0.13", default-features = false} +ratframe = {version = "1.1.3", default-features = false} #disable defaults features for rat frame if you do not want to import eframe diff --git a/src/lib.rs b/src/lib.rs index 00eb3fb..f04312c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,11 +3,15 @@ mod ratagui_backend; pub use ratagui_backend::RataguiBackend; - +#[cfg(feature = "eframe")] mod wasm_runner; -#[cfg(not(target_arch = "wasm32"))] +#[cfg(all(not(target_arch = "wasm32"),feature="eframe"))] pub use wasm_runner::native_setup; + +#[cfg(feature = "eframe")] pub use wasm_runner::NewCC; -#[cfg(target_arch = "wasm32")] +#[cfg(all(target_arch = "wasm32", feature = "eframe"))] pub use wasm_runner::wasm_setup; + + diff --git a/src/ratagui_backend.rs b/src/ratagui_backend.rs index c4e7c3d..01f37fd 100644 --- a/src/ratagui_backend.rs +++ b/src/ratagui_backend.rs @@ -1,13 +1,14 @@ //! This module provides the `RataguiBackend` implementation for the [`Backend`] trait. //! It is used in the integration tests to verify the correctness of the library. -use eframe::egui::text::TextWrapping; -use eframe::egui::{Label, Response, Stroke, Ui}; -use eframe::epaint::{ +use egui::text::TextWrapping; +use egui::{Label, Response, Stroke, Ui}; +use egui::epaint::{ text::{LayoutJob, TextFormat}, Color32, FontFamily, FontId, Fonts, }; + use ratatui::style::{Color, Modifier}; use std::f32::INFINITY; use std::io; @@ -40,7 +41,7 @@ pub struct RataguiBackend { blinking_slow: bool, blinking_fast: bool, } -impl eframe::egui::Widget for &mut RataguiBackend { +impl egui::Widget for &mut RataguiBackend { fn ui(self, ui: &mut Ui) -> Response { ui.spacing_mut().item_spacing.x = 0.0; ui.spacing_mut().item_spacing.y = 0.0;