Removed pub
on some things that should be private
This commit is contained in:
parent
442b876cb5
commit
997103a910
5 changed files with 19 additions and 16 deletions
|
@ -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<Frame>,
|
||||
pub resize: Resize,
|
||||
pub scroll: Option<ScrollArea>,
|
||||
pub collapsible: bool,
|
||||
pub with_title_bar: bool,
|
||||
area: Area,
|
||||
frame: Option<Frame>,
|
||||
resize: Resize,
|
||||
scroll: Option<ScrollArea>,
|
||||
collapsible: bool,
|
||||
with_title_bar: bool,
|
||||
}
|
||||
|
||||
impl<'open> Window<'open> {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -116,7 +116,7 @@ impl PaintList {
|
|||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct GraphicLayers([AHashMap<Id, PaintList>; Order::COUNT]);
|
||||
pub(crate) struct GraphicLayers([AHashMap<Id, PaintList>; Order::COUNT]);
|
||||
|
||||
impl GraphicLayers {
|
||||
pub fn list(&mut self, layer_id: LayerId) -> &mut PaintList {
|
||||
|
|
|
@ -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<usize>) -> String {
|
||||
pub(crate) fn format_with_decimals_in_range(
|
||||
value: f64,
|
||||
decimal_range: RangeInclusive<usize>,
|
||||
) -> String {
|
||||
let min_decimals = *decimal_range.start();
|
||||
let max_decimals = *decimal_range.end();
|
||||
debug_assert!(min_decimals <= max_decimals);
|
||||
|
|
|
@ -263,7 +263,7 @@ pub enum FontSource {
|
|||
Emoji(usize),
|
||||
}
|
||||
|
||||
pub struct FontImplCache {
|
||||
struct FontImplCache {
|
||||
atlas: Arc<Mutex<TextureAtlas>>,
|
||||
pixels_per_point: f32,
|
||||
rusttype_fonts: std::collections::BTreeMap<String, Arc<rusttype::Font<'static>>>,
|
||||
|
|
Loading…
Reference in a new issue