WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2885,7 +2885,7 @@ impl Context {
self.input(|i| i.pointer.hover_pos())
}

/// If you detect a click or drag and wants to know where it happened, use this.
/// If you detect a click or drag and want to know where it happened, use this.
///
/// Latest position of the mouse, but ignoring any [`crate::Event::PointerGone`]
/// if there were interactions this pass.
Expand Down Expand Up @@ -2958,7 +2958,7 @@ impl Context {

/// Moves the given area to the top in its [`Order`].
///
/// [`crate::Area`]:s and [`crate::Window`]:s also do this automatically when being clicked on or interacted with.
/// [`crate::Area`]s and [`crate::Window`]s also do this automatically when being clicked on or interacted with.
pub fn move_to_top(&self, layer_id: LayerId) {
self.memory_mut(|mem| mem.areas_mut().move_to_top(layer_id));
}
Expand Down Expand Up @@ -3077,7 +3077,7 @@ impl Context {
/// for a responsive start and a slow end.
///
/// The easing function flips when `target_value` is `false`,
/// so that when going back towards 0.0, we get
/// so that when going back towards 0.0, we get the reverse behavior.
#[track_caller] // To track repaint cause
pub fn animate_bool_with_time_and_easing(
&self,
Expand Down Expand Up @@ -3958,7 +3958,7 @@ impl Context {
/// Show an immediate viewport, creating a new native window, if possible.
///
/// This is the easier type of viewport to use, but it is less performant
/// at it requires both parent and child to repaint if any one of them needs repainting,
/// as it requires both parent and child to repaint if any one of them needs repainting,
/// which effectively produce double work for two viewports, and triple work for three viewports, etc.
/// To avoid this, use [`Self::show_viewport_deferred`] instead.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
//! * lays out the letters `click me` in order to figure out the size of the button
//! * decides where on screen to place the button
//! * check if the mouse is hovering or clicking that location
//! * chose button colors based on if it is being hovered or clicked
//! * choose button colors based on if it is being hovered or clicked
//! * add a [`Shape::Rect`] and [`Shape::Text`] to the list of shapes to be painted later this frame
//! * return a [`Response`] with the [`clicked`](`Response::clicked`) member so the user can check for interactions
//!
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub use theme::{Theme, ThemePreference};
/// how far the user has scrolled in a [`ScrollArea`](crate::ScrollArea) etc.
///
/// If you want this to persist when closing your app, you should serialize [`Memory`] and store it.
/// For this you need to enable the `persistence`.
/// For this you need to enable the `persistence` feature.
///
/// If you want to store data for your widgets, you should look at [`Memory::data`]
#[derive(Clone, Debug)]
Expand Down
20 changes: 10 additions & 10 deletions crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ pub struct Ui {
/// This value is based on where in the hierarchy of widgets this Ui is in,
/// and the value is increment with each added child widget.
/// This works as an Id source only as long as new widgets aren't added or removed.
/// They are therefore only good for Id:s that has no state.
/// They are therefore only good for Id:s that have no state.
next_auto_id_salt: u64,

/// Specifies paint layer, clip rectangle and a reference to [`Context`].
painter: Painter,

/// The [`Style`] (visuals, spacing, etc) of this ui.
/// Commonly many [`Ui`]:s share the same [`Style`].
/// Commonly many [`Ui`]s share the same [`Style`].
/// The [`Ui`] implements copy-on-write for this.
style: Arc<Style>,

Expand Down Expand Up @@ -428,7 +428,7 @@ impl Ui {
/// Mutably borrow internal [`Style`].
/// Changes apply to this [`Ui`] and its subsequent children.
///
/// To set the style of all [`Ui`]:s, use [`Context::set_style_of`].
/// To set the style of all [`Ui`]s, use [`Context::set_style_of`].
///
/// Example:
/// ```
Expand All @@ -442,7 +442,7 @@ impl Ui {

/// Changes apply to this [`Ui`] and its subsequent children.
///
/// To set the visuals of all [`Ui`]:s, use [`Context::set_visuals_of`].
/// To set the style of all [`Ui`]s, use [`Context::set_style_of`].
pub fn set_style(&mut self, style: impl Into<Arc<Style>>) {
self.style = style.into();
}
Expand Down Expand Up @@ -482,7 +482,7 @@ impl Ui {
/// Mutably borrow internal `visuals`.
/// Changes apply to this [`Ui`] and its subsequent children.
///
/// To set the visuals of all [`Ui`]:s, use [`Context::set_visuals_of`].
/// To set the visuals of all [`Ui`]s, use [`Context::set_visuals_of`].
///
/// Example:
/// ```
Expand Down Expand Up @@ -1150,8 +1150,8 @@ impl Ui {
self.interact(rect, id, sense)
}

/// Read the [`Ui`]s background [`Response`].
/// It's [`Sense`] will be based on the [`UiBuilder::sense`] used to create this [`Ui`].
/// Read the [`Ui`]'s background [`Response`].
/// Its [`Sense`] will be based on the [`UiBuilder::sense`] used to create this [`Ui`].
///
/// The rectangle of the [`Response`] (and interactive area) will be [`Self::min_rect`]
/// of the last pass.
Expand Down Expand Up @@ -1251,7 +1251,7 @@ impl Ui {
/// [`crate::Area`], [`crate::Window`], [`crate::CollapsingHeader`], etc.
///
/// What exactly happens when you close a container depends on the container implementation.
/// [`crate::Area`] e.g. will return true from it's [`Response::should_close`] method.
/// [`crate::Area`] e.g. will return true from its [`Response::should_close`] method.
///
/// If you want to close a specific kind of container, use [`Ui::close_kind`] instead.
///
Expand Down Expand Up @@ -2292,7 +2292,7 @@ impl Ui {
/// Show an image available at the given `uri`.
///
/// ⚠ This will do nothing unless you install some image loaders first!
/// The easiest way to do this is via [`egui_extras::install_image_loaders`](https://docs.rs/egui_extras/latest/egui_extras/fn.install_image_loaders.html).
/// The easiest way to do this is via [`egui_extras::install_image_loaders`](https://docs.rs/egui_extras/latest/egui_extras/loaders/fn.install_image_loaders.html).
///
/// The loaders handle caching image data, sampled textures, etc. across frames, so calling this is immediate-mode safe.
///
Expand Down Expand Up @@ -2368,7 +2368,7 @@ impl Ui {
///
/// If the user clicks the button, a full color picker is shown.
/// The given color is in `sRGBA` space without premultiplied alpha.
/// If unsure, what "premultiplied alpha" is, then this is probably the function you want to use.
/// If unsure what "premultiplied alpha" is, then this is probably the function you want to use.
pub fn color_edit_button_srgba_unmultiplied(&mut self, srgba: &mut [u8; 4]) -> Response {
let mut rgba = Rgba::from_srgba_unmultiplied(srgba[0], srgba[1], srgba[2], srgba[3]);
let response =
Expand Down