diff --git a/egui/src/containers/window.rs b/egui/src/containers/window.rs index 01e069fd..7cf248f0 100644 --- a/egui/src/containers/window.rs +++ b/egui/src/containers/window.rs @@ -13,14 +13,14 @@ use super::*; /// * if the window can be collapsed (minimized) to just the title bar (yes, by default) /// * if there should be a close button (none by default) pub struct Window<'open> { - pub title_label: Label, + title_label: Label, open: Option<&'open mut bool>, - pub area: Area, - pub frame: Option, - pub resize: Resize, - pub scroll: Option, - pub collapsible: bool, - pub with_title_bar: bool, + area: Area, + frame: Option, + resize: Resize, + scroll: Option, + collapsible: bool, + with_title_bar: bool, } impl<'open> Window<'open> { diff --git a/egui/src/context.rs b/egui/src/context.rs index ce6c2c1b..789fb1f9 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -417,7 +417,7 @@ impl Context { self.memory.lock() } - pub fn graphics(&self) -> MutexGuard<'_, GraphicLayers> { + pub(crate) fn graphics(&self) -> MutexGuard<'_, GraphicLayers> { self.graphics.lock() } @@ -477,23 +477,23 @@ impl Context { } /// Useful for pixel-perfect rendering - pub fn round_to_pixel(&self, point: f32) -> f32 { + pub(crate) fn round_to_pixel(&self, point: f32) -> f32 { let pixels_per_point = self.pixels_per_point(); (point * pixels_per_point).round() / pixels_per_point } /// Useful for pixel-perfect rendering - pub fn round_pos_to_pixels(&self, pos: Pos2) -> Pos2 { + pub(crate) fn round_pos_to_pixels(&self, pos: Pos2) -> Pos2 { pos2(self.round_to_pixel(pos.x), self.round_to_pixel(pos.y)) } /// Useful for pixel-perfect rendering - pub fn round_vec_to_pixels(&self, vec: Vec2) -> Vec2 { + pub(crate) fn round_vec_to_pixels(&self, vec: Vec2) -> Vec2 { vec2(self.round_to_pixel(vec.x), self.round_to_pixel(vec.y)) } /// Useful for pixel-perfect rendering - pub fn round_rect_to_pixels(&self, rect: Rect) -> Rect { + pub(crate) fn round_rect_to_pixels(&self, rect: Rect) -> Rect { Rect { min: self.round_pos_to_pixels(rect.min), max: self.round_pos_to_pixels(rect.max), diff --git a/egui/src/layers.rs b/egui/src/layers.rs index fe19b771..d1e2caae 100644 --- a/egui/src/layers.rs +++ b/egui/src/layers.rs @@ -116,7 +116,7 @@ impl PaintList { } #[derive(Clone, Default)] -pub struct GraphicLayers([AHashMap; Order::COUNT]); +pub(crate) struct GraphicLayers([AHashMap; Order::COUNT]); impl GraphicLayers { pub fn list(&mut self, layer_id: LayerId) -> &mut PaintList { diff --git a/egui/src/math/mod.rs b/egui/src/math/mod.rs index e9a3663b..680481d7 100644 --- a/egui/src/math/mod.rs +++ b/egui/src/math/mod.rs @@ -122,11 +122,14 @@ pub fn round_to_decimals(value: f64, decimal_places: usize) -> f64 { .unwrap_or(value) } -pub fn format_with_minimum_decimals(value: f64, decimals: usize) -> String { +pub(crate) fn format_with_minimum_decimals(value: f64, decimals: usize) -> String { format_with_decimals_in_range(value, decimals..=6) } -pub fn format_with_decimals_in_range(value: f64, decimal_range: RangeInclusive) -> String { +pub(crate) fn format_with_decimals_in_range( + value: f64, + decimal_range: RangeInclusive, +) -> String { let min_decimals = *decimal_range.start(); let max_decimals = *decimal_range.end(); debug_assert!(min_decimals <= max_decimals); diff --git a/egui/src/paint/fonts.rs b/egui/src/paint/fonts.rs index 180bc9ef..0211ad52 100644 --- a/egui/src/paint/fonts.rs +++ b/egui/src/paint/fonts.rs @@ -263,7 +263,7 @@ pub enum FontSource { Emoji(usize), } -pub struct FontImplCache { +struct FontImplCache { atlas: Arc>, pixels_per_point: f32, rusttype_fonts: std::collections::BTreeMap>>,