diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index 923982dc..f561d264 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -1,10 +1,7 @@ use std::hash::Hash; -use crate::{ - paint::{Shape, TextStyle}, - widgets::Label, - *, -}; +use crate::{widgets::Label, *}; +use epaint::{Shape, TextStyle}; #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))] diff --git a/egui/src/containers/combo_box.rs b/egui/src/containers/combo_box.rs index 01f6d9dc..f9424e99 100644 --- a/egui/src/containers/combo_box.rs +++ b/egui/src/containers/combo_box.rs @@ -1,4 +1,5 @@ -use crate::{paint::Shape, style::WidgetVisuals, *}; +use crate::{style::WidgetVisuals, *}; +use epaint::Shape; /// A drop-down selection menu with a descriptive label. /// diff --git a/egui/src/containers/frame.rs b/egui/src/containers/frame.rs index c969853b..4a725f4f 100644 --- a/egui/src/containers/frame.rs +++ b/egui/src/containers/frame.rs @@ -1,6 +1,7 @@ //! Frame container -use crate::{layers::ShapeIdx, paint::*, *}; +use crate::{layers::ShapeIdx, *}; +use epaint::*; /// Color and margin of a rectangular background of a [`Ui`]. #[derive(Clone, Copy, Debug, Default, PartialEq)] diff --git a/egui/src/containers/resize.rs b/egui/src/containers/resize.rs index 712d4f4d..025aa451 100644 --- a/egui/src/containers/resize.rs +++ b/egui/src/containers/resize.rs @@ -281,7 +281,7 @@ impl Resize { if self.with_stroke && corner_response.is_some() { let rect = Rect::from_min_size(content_ui.min_rect().left_top(), state.desired_size); let rect = rect.expand(2.0); // breathing room for content - ui.painter().add(paint::Shape::Rect { + ui.painter().add(epaint::Shape::Rect { rect, corner_radius: 3.0, fill: Default::default(), @@ -314,7 +314,7 @@ impl Resize { } } -use crate::paint::Stroke; +use epaint::Stroke; pub fn paint_resize_corner(ui: &mut Ui, response: &Response) { let stroke = ui.style().interact(response).fg_stroke; diff --git a/egui/src/containers/scroll_area.rs b/egui/src/containers/scroll_area.rs index 117dcd82..0d280e9b 100644 --- a/egui/src/containers/scroll_area.rs +++ b/egui/src/containers/scroll_area.rs @@ -328,7 +328,7 @@ impl Prepared { let visuals = ui.style().interact(&response); - ui.painter().add(paint::Shape::Rect { + ui.painter().add(epaint::Shape::Rect { rect: outer_scroll_rect, corner_radius, fill: ui.visuals().extreme_bg_color, @@ -337,7 +337,7 @@ impl Prepared { // stroke: visuals.bg_stroke, }); - ui.painter().add(paint::Shape::Rect { + ui.painter().add(epaint::Shape::Rect { rect: handle_rect.expand(-2.0), corner_radius, fill: visuals.bg_fill, diff --git a/egui/src/containers/window.rs b/egui/src/containers/window.rs index 7b0f7f68..50b15cd4 100644 --- a/egui/src/containers/window.rs +++ b/egui/src/containers/window.rs @@ -1,6 +1,7 @@ // WARNING: the code in here is horrible. It is a behemoth that needs breaking up into simpler parts. -use crate::{paint::*, widgets::*, *}; +use crate::{widgets::*, *}; +use epaint::*; use super::*; @@ -611,7 +612,7 @@ fn paint_frame_interaction( interaction: WindowInteraction, visuals: style::WidgetVisuals, ) { - use paint::tessellator::path::add_circle_quadrant; + use epaint::tessellator::path::add_circle_quadrant; let cr = ui.visuals().window_corner_radius; let Rect { min, max } = rect; diff --git a/egui/src/context.rs b/egui/src/context.rs index 0c5a4100..8ca12c03 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -12,9 +12,9 @@ use crate::{ input_state::*, layers::GraphicLayers, mutex::{Mutex, MutexGuard}, - paint::{stats::*, text::Fonts, *}, *, }; +use epaint::{stats::*, text::Fonts, *}; // ---------------------------------------------------------------------------- @@ -383,7 +383,7 @@ impl Context { /// The egui texture, containing font characters etc. /// Not valid until first call to [`CtxRef::begin_frame()`]. /// That's because since we don't know the proper `pixels_per_point` until then. - pub fn texture(&self) -> Arc { + pub fn texture(&self) -> Arc { self.fonts().texture() } diff --git a/egui/src/frame_state.rs b/egui/src/frame_state.rs index 7a9755dd..3d7c0b91 100644 --- a/egui/src/frame_state.rs +++ b/egui/src/frame_state.rs @@ -1,4 +1,5 @@ -use crate::{paint::ahash, *}; +use crate::*; +use epaint::ahash; /// State that is collected during a frame and then cleared. /// Short-term (single frame) memory. diff --git a/egui/src/input_state.rs b/egui/src/input_state.rs index 7262a325..dab8bccb 100644 --- a/egui/src/input_state.rs +++ b/egui/src/input_state.rs @@ -491,7 +491,7 @@ impl InputState { events, } = self; - ui.style_mut().body_text_style = crate::paint::TextStyle::Monospace; + ui.style_mut().body_text_style = epaint::TextStyle::Monospace; ui.collapsing("Raw Input", |ui| raw.ui(ui)); crate::containers::CollapsingHeader::new("🖱 Pointer") diff --git a/egui/src/layout.rs b/egui/src/layout.rs index 9a2bb1e2..f0620770 100644 --- a/egui/src/layout.rs +++ b/egui/src/layout.rs @@ -538,7 +538,7 @@ impl Layout { stroke: epaint::Stroke, painter: &crate::Painter, ) { - use crate::paint::*; + use epaint::*; let cursor = region.cursor; diff --git a/egui/src/lib.rs b/egui/src/lib.rs index 76159b84..1529be17 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -121,11 +121,14 @@ mod ui; pub mod util; pub mod widgets; -pub use epaint as paint; +pub use epaint; pub use epaint::emath; // Can't add deprecation notice due to https://github.com/rust-lang/rust/issues/30827 -pub use emath as math; +pub use epaint as paint; // historical reasons + +// Can't add deprecation notice due to https://github.com/rust-lang/rust/issues/30827 +pub use emath as math; // historical reasons pub use emath::{ clamp, lerp, pos2, remap, remap_clamp, vec2, Align, Align2, NumExt, Pos2, Rect, Vec2, diff --git a/egui/src/memory.rs b/egui/src/memory.rs index e6d6ee36..5789b32c 100644 --- a/egui/src/memory.rs +++ b/egui/src/memory.rs @@ -1,13 +1,10 @@ use std::collections::{HashMap, HashSet}; use crate::{ - area, collapsing_header, menu, - paint::color::{Color32, Hsva}, - resize, scroll_area, - util::Cache, - widgets::text_edit, - window, Id, LayerId, Pos2, Rect, Style, + area, collapsing_header, menu, resize, scroll_area, util::Cache, widgets::text_edit, window, + Id, LayerId, Pos2, Rect, Style, }; +use epaint::color::{Color32, Hsva}; // ---------------------------------------------------------------------------- @@ -68,9 +65,9 @@ pub(crate) struct Options { #[cfg_attr(feature = "persistence", serde(skip))] pub(crate) style: std::sync::Arc