Browse Source

Fix typos (#2866)

* Fix typos in comments

* Fix typos in demo texts

* Fix typos in code names

* Fix typos in cargos

* Fix typos in changelogs
pull/2905/head
Jozef Číž 2 years ago
committed by GitHub
parent
commit
33aa4d698f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      crates/ecolor/Cargo.toml
  2. 2
      crates/eframe/src/native/run.rs
  3. 2
      crates/egui-wgpu/CHANGELOG.md
  4. 2
      crates/egui-wgpu/src/renderer.rs
  5. 2
      crates/egui-winit/CHANGELOG.md
  6. 6
      crates/egui-winit/src/lib.rs
  7. 4
      crates/egui/Cargo.toml
  8. 4
      crates/egui/src/containers/panel.rs
  9. 4
      crates/egui/src/context.rs
  10. 2
      crates/egui/src/data/output.rs
  11. 8
      crates/egui/src/id.rs
  12. 2
      crates/egui/src/lib.rs
  13. 2
      crates/egui/src/style.rs
  14. 6
      crates/egui/src/widgets/slider.rs
  15. 4
      crates/egui/src/widgets/text_edit/builder.rs
  16. 2
      crates/egui_demo_app/src/lib.rs
  17. 2
      crates/egui_demo_lib/src/color_test.rs
  18. 2
      crates/egui_demo_lib/src/demo/tests.rs
  19. 6
      crates/egui_extras/src/datepicker/popup.rs
  20. 2
      crates/egui_glium/CHANGELOG.md
  21. 2
      crates/egui_glow/CHANGELOG.md
  22. 2
      crates/egui_web/CHANGELOG.md
  23. 2
      crates/emath/Cargo.toml
  24. 4
      crates/epaint/Cargo.toml
  25. 4
      crates/epaint/src/bezier.rs
  26. 4
      crates/epaint/src/mutex.rs
  27. 6
      crates/epaint/src/shape.rs
  28. 6
      crates/epaint/src/shape_transform.rs
  29. 4
      crates/epaint/src/tessellator.rs
  30. 2
      crates/epaint/src/textures.rs

2
crates/ecolor/Cargo.toml

@ -37,7 +37,7 @@ extra_asserts = []
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast `ecolor` types to `&[u8]`.
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
## [`cint`](https://docs.rs/cint) enables interopability with other color libraries.
## [`cint`](https://docs.rs/cint) enables interoperability with other color libraries.
cint = { version = "0.3.1", optional = true }
## Enable the [`hex_color`] macro.

2
crates/eframe/src/native/run.rs

@ -366,7 +366,7 @@ mod glow_integration {
}
impl GlutinWindowContext {
/// There is a lot of complexity with opengl creation, so prefer extensivve logging to get all the help we can to debug issues.
/// There is a lot of complexity with opengl creation, so prefer extensive logging to get all the help we can to debug issues.
///
#[allow(unsafe_code)]
unsafe fn new(

2
crates/egui-wgpu/CHANGELOG.md

@ -3,7 +3,7 @@ All notable changes to the `egui-wgpu` integration will be noted in this file.
## Unreleased
* Add `read_screan_rgba` to the egui-wgpu `Painter`, to allow for capturing the current frame when using wgpu. Used in conjuction with `Frame::request_screenshot`. ([#2676](https://github.com/emilk/egui/pull/2676))
* Add `read_screen_rgba` to the egui-wgpu `Painter`, to allow for capturing the current frame when using wgpu. Used in conjunction with `Frame::request_screenshot`. ([#2676](https://github.com/emilk/egui/pull/2676))
* Improve performance of `update_buffers` ([#2820](https://github.com/emilk/egui/pull/2820))
* Added support for multisampling (MSAA) ([#2878](https://github.com/emilk/egui/pull/2878))

2
crates/egui-wgpu/src/renderer.rs

@ -935,7 +935,7 @@ fn create_index_buffer(device: &wgpu::Device, size: u64) -> wgpu::Buffer {
})
}
/// A Rect in physical pixel space, used for setting cliipping rectangles.
/// A Rect in physical pixel space, used for setting clipping rectangles.
struct ScissorRect {
x: u32,
y: u32,

2
crates/egui-winit/CHANGELOG.md

@ -46,7 +46,7 @@ All notable changes to the `egui-winit` integration will be noted in this file.
## 0.17.0 - 2022-02-22
* Fixed horizontal scrolling direction on Linux.
* Replaced `std::time::Instant` with `instant::Instant` for WebAssembly compatability ([#1023](https://github.com/emilk/egui/pull/1023))
* Replaced `std::time::Instant` with `instant::Instant` for WebAssembly compatibility ([#1023](https://github.com/emilk/egui/pull/1023))
* Automatically detect and apply dark or light mode from system ([#1045](https://github.com/emilk/egui/pull/1045)).
* Fixed `enable_drag` on Windows OS ([#1108](https://github.com/emilk/egui/pull/1108)).
* Shift-scroll will now result in horizontal scrolling on all platforms ([#1136](https://github.com/emilk/egui/pull/1136)).

6
crates/egui-winit/src/lib.rs

@ -268,7 +268,7 @@ impl State {
}
}
WindowEvent::Ime(ime) => {
// on Mac even Cmd-C is preessed during ime, a `c` is pushed to Preedit.
// on Mac even Cmd-C is pressed during ime, a `c` is pushed to Preedit.
// So no need to check is_mac_cmd.
//
// How winit produce `Ime::Enabled` and `Ime::Disabled` differs in MacOS
@ -279,7 +279,7 @@ impl State {
// - On MacOS, only when user explicit enable/disable ime. No Disabled
// after Commit.
//
// We use input_method_editor_started to mannualy insert CompositionStart
// We use input_method_editor_started to manually insert CompositionStart
// between Commits.
match ime {
winit::event::Ime::Enabled | winit::event::Ime::Disabled => (),
@ -510,7 +510,7 @@ impl State {
None => 0_f32,
},
});
// If we're not yet tanslating a touch or we're translating this very
// If we're not yet translating a touch or we're translating this very
// touch …
if self.pointer_touch_id.is_none() || self.pointer_touch_id.unwrap() == touch.id {
// … emit PointerButton resp. PointerMoved events to emulate mouse

4
crates/egui/Cargo.toml

@ -25,7 +25,7 @@ default = ["default_fonts"]
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`epaint::Vertex`], [`emath::Vec2`] etc to `&[u8]`.
bytemuck = ["epaint/bytemuck"]
## [`cint`](https://docs.rs/cint) enables interopability with other color libraries.
## [`cint`](https://docs.rs/cint) enables interoperability with other color libraries.
cint = ["epaint/cint"]
## Enable the [`hex_color`] macro.
@ -45,7 +45,7 @@ extra_debug_asserts = ["epaint/extra_debug_asserts"]
## Always enable additional checks.
extra_asserts = ["epaint/extra_asserts"]
## [`mint`](https://docs.rs/mint) enables interopability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = ["epaint/mint"]
## Enable persistence of memory (window positions etc).

4
crates/egui/src/containers/panel.rs

@ -301,7 +301,7 @@ impl SidePanel {
} else if resize_hover {
ui.style().visuals.widgets.hovered.fg_stroke // highly visible
} else if show_separator_line {
// TOOD(emilk): distinguish resizable from non-resizable
// TODO(emilk): distinguish resizable from non-resizable
ui.style().visuals.widgets.noninteractive.bg_stroke // dim
} else {
Stroke::NONE
@ -752,7 +752,7 @@ impl TopBottomPanel {
} else if resize_hover {
ui.style().visuals.widgets.hovered.fg_stroke // highly visible
} else if show_separator_line {
// TOOD(emilk): distinguish resizable from non-resizable
// TODO(emilk): distinguish resizable from non-resizable
ui.style().visuals.widgets.noninteractive.bg_stroke // dim
} else {
Stroke::NONE

4
crates/egui/src/context.rs

@ -203,7 +203,7 @@ impl ContextImpl {
///
/// ``` no_run
/// # fn handle_platform_output(_: egui::PlatformOutput) {}
/// # fn paint(textures_detla: egui::TexturesDelta, _: Vec<egui::ClippedPrimitive>) {}
/// # fn paint(textures_delta: egui::TexturesDelta, _: Vec<egui::ClippedPrimitive>) {}
/// let mut ctx = egui::Context::default();
///
/// // Game loop:
@ -890,7 +890,7 @@ impl Context {
/// Duration begins at the next frame. lets say for example that its a very inefficient app
/// and takes 500 milliseconds per frame at 2 fps. The widget / user might want a repaint in
/// next 500 milliseconds. Now, app takes 1000 ms per frame (1 fps) because the backend event
/// timeout takes 500 milli seconds AFTER the vsync swap buffer.
/// timeout takes 500 milliseconds AFTER the vsync swap buffer.
/// So, its not that we are requesting repaint within X duration. We are rather timing out
/// during app idle time where we are not receiving any new input events.
pub fn request_repaint_after(&self, duration: std::time::Duration) {

2
crates/egui/src/data/output.rs

@ -150,7 +150,7 @@ impl PlatformOutput {
/// Take everything ephemeral (everything except `cursor_icon` currently)
pub fn take(&mut self) -> Self {
let taken = std::mem::take(self);
self.cursor_icon = taken.cursor_icon; // eveything else is ephemeral
self.cursor_icon = taken.cursor_icon; // everything else is ephemeral
taken
}
}

8
crates/egui/src/id.rs

@ -157,9 +157,9 @@ impl std::hash::Hasher for IdHasher {
#[derive(Copy, Clone, Debug, Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct BuilIdHasher {}
pub struct BuildIdHasher {}
impl std::hash::BuildHasher for BuilIdHasher {
impl std::hash::BuildHasher for BuildIdHasher {
type Hasher = IdHasher;
#[inline(always)]
@ -169,7 +169,7 @@ impl std::hash::BuildHasher for BuilIdHasher {
}
/// `IdSet` is a `HashSet<Id>` optimized by knowing that [`Id`] has good entropy, and doesn't need more hashing.
pub type IdSet = std::collections::HashSet<Id, BuilIdHasher>;
pub type IdSet = std::collections::HashSet<Id, BuildIdHasher>;
/// `IdMap<V>` is a `HashMap<Id, V>` optimized by knowing that [`Id`] has good entropy, and doesn't need more hashing.
pub type IdMap<V> = std::collections::HashMap<Id, V, BuilIdHasher>;
pub type IdMap<V> = std::collections::HashMap<Id, V, BuildIdHasher>;

2
crates/egui/src/lib.rs

@ -112,7 +112,7 @@
//! ``` no_run
//! # fn handle_platform_output(_: egui::PlatformOutput) {}
//! # fn gather_input() -> egui::RawInput { egui::RawInput::default() }
//! # fn paint(textures_detla: egui::TexturesDelta, _: Vec<egui::ClippedPrimitive>) {}
//! # fn paint(textures_delta: egui::TexturesDelta, _: Vec<egui::ClippedPrimitive>) {}
//! let mut ctx = egui::Context::default();
//!
//! // Game loop:

2
crates/egui/src/style.rs

@ -1441,7 +1441,7 @@ impl DebugOptions {
ui.checkbox(
show_blocking_widget,
"Show wha widget blocks the interaction of another widget",
"Show which widget blocks the interaction of another widget",
);
ui.vertical_centered(|ui| reset_button(ui, self));

6
crates/egui/src/widgets/slider.rs

@ -892,7 +892,7 @@ fn value_from_normalized(normalized: f64, range: RangeInclusive<f64>, spec: &Sli
10.0_f64.powf(log)
} else {
assert!(min < 0.0 && 0.0 < max);
let zero_cutoff = logaritmic_zero_cutoff(min, max);
let zero_cutoff = logarithmic_zero_cutoff(min, max);
if normalized < zero_cutoff {
// negative
value_from_normalized(
@ -941,7 +941,7 @@ fn normalized_from_value(value: f64, range: RangeInclusive<f64>, spec: &SliderSp
remap_clamp(value_log, min_log..=max_log, 0.0..=1.0)
} else {
assert!(min < 0.0 && 0.0 < max);
let zero_cutoff = logaritmic_zero_cutoff(min, max);
let zero_cutoff = logarithmic_zero_cutoff(min, max);
if value < 0.0 {
// negative
remap(
@ -992,7 +992,7 @@ fn range_log10(min: f64, max: f64, spec: &SliderSpec) -> (f64, f64) {
/// where to put the zero cutoff for logarithmic sliders
/// that crosses zero ?
fn logaritmic_zero_cutoff(min: f64, max: f64) -> f64 {
fn logarithmic_zero_cutoff(min: f64, max: f64) -> f64 {
assert!(min < 0.0 && 0.0 < max);
let min_magnitude = if min == -INFINITY {

4
crates/egui/src/widgets/text_edit/builder.rs

@ -955,7 +955,7 @@ fn events(
let mut ccursor = delete_selected(text, &cursor_range);
if modifiers.shift {
// TODO(emilk): support removing indentation over a selection?
decrease_identation(&mut ccursor, text);
decrease_indentation(&mut ccursor, text);
} else {
insert_text(&mut ccursor, text, "\t", char_limit);
}
@ -1619,7 +1619,7 @@ fn find_line_start(text: &str, current_index: CCursor) -> CCursor {
}
}
fn decrease_identation(ccursor: &mut CCursor, text: &mut dyn TextBuffer) {
fn decrease_indentation(ccursor: &mut CCursor, text: &mut dyn TextBuffer) {
let line_start = find_line_start(text.as_str(), *ccursor);
let remove_len = if text.as_str()[line_start.index..].starts_with('\t') {

2
crates/egui_demo_app/src/lib.rs

@ -39,7 +39,7 @@ impl WebHandle {
}
#[wasm_bindgen]
pub fn set_some_content_from_javasript(&mut self, _some_data: &str) {
pub fn set_some_content_from_javascript(&mut self, _some_data: &str) {
let _app = self.handle.lock().app_mut::<WrapApp>();
// _app.data = some_data;
}

2
crates/egui_demo_lib/src/color_test.rs

@ -40,7 +40,7 @@ impl ColorTest {
ui.horizontal_wrapped(|ui|{
ui.label("This is made to test that the egui painter backend is set up correctly.");
ui.add(egui::Label::new("❓").sense(egui::Sense::click()))
.on_hover_text("The texture sampling should be sRGB-aware, and everyt other color operation should be done in gamma-space (sRGB). All colors should use pre-multiplied alpha");
.on_hover_text("The texture sampling should be sRGB-aware, and every other color operation should be done in gamma-space (sRGB). All colors should use pre-multiplied alpha");
});
ui.label("If the rendering is done right, all groups of gradients will look uniform.");

2
crates/egui_demo_lib/src/demo/tests.rs

@ -70,7 +70,7 @@ impl super::View for IdTest {
As long as elements are not added or removed, the Id stays the same. \
This is fine, because during interaction (i.e. while dragging a slider), \
the number of widgets previously in the same window is most likely not changing \
(and if it is, the window will have a new layout, and the slider will endup somewhere else, and so aborthing the interaction probably makes sense).");
(and if it is, the window will have a new layout, and the slider will end up somewhere else, and so aborting the interaction probably makes sense).");
ui.label("So these buttons have automatic Id:s, and therefore there is no name clash:");
let _ = ui.button("Button");

6
crates/egui_extras/src/datepicker/popup.rs

@ -155,7 +155,7 @@ impl<'a> DatePickerPopup<'a> {
ui.with_layout(Layout::top_down_justified(Align::Center), |ui| {
if ui
.button("<<<")
.on_hover_text("substract one year")
.on_hover_text("subtract one year")
.clicked()
{
popup_state.year -= 1;
@ -171,7 +171,7 @@ impl<'a> DatePickerPopup<'a> {
ui.with_layout(Layout::top_down_justified(Align::Center), |ui| {
if ui
.button("<<")
.on_hover_text("substract one month")
.on_hover_text("subtract one month")
.clicked()
{
popup_state.month -= 1;
@ -189,7 +189,7 @@ impl<'a> DatePickerPopup<'a> {
});
strip.cell(|ui| {
ui.with_layout(Layout::top_down_justified(Align::Center), |ui| {
if ui.button("<").on_hover_text("substract one day").clicked() {
if ui.button("<").on_hover_text("subtract one day").clicked() {
popup_state.day -= 1;
if popup_state.day == 0 {
popup_state.month -= 1;

2
crates/egui_glium/CHANGELOG.md

@ -60,7 +60,7 @@ All notable changes to the `egui_glium` integration will be noted in this file.
## 0.13.0 - 2021-06-24
* Added `EguiGlium::is_quit_event` to replace `control_flow` arguemnt to `EguiGlium::on_event`.
* Added `EguiGlium::is_quit_event` to replace `control_flow` argument to `EguiGlium::on_event`.
* [Fix modifier key for zoom with mouse wheel on Mac](https://github.com/emilk/egui/issues/401)
* [Fix stuck modifier keys](https://github.com/emilk/egui/pull/479)

2
crates/egui_glow/CHANGELOG.md

@ -16,7 +16,7 @@ All notable changes to the `egui_glow` integration will be noted in this file.
## 0.20.0 - 2022-12-08
* Allow empty textures.
* Added `shader_version` variable on `EguiGlow::new` for easier cross compilling on different OpenGL | ES targets ([#1993](https://github.com/emilk/egui/pull/1993)).
* Added `shader_version` variable on `EguiGlow::new` for easier cross compiling on different OpenGL | ES targets ([#1993](https://github.com/emilk/egui/pull/1993)).
## 0.19.0 - 2022-08-20

2
crates/egui_web/CHANGELOG.md

@ -110,7 +110,7 @@ Contributors: [n2](https://github.com/n2)
### Added ⭐
* A simple HTTP fetch API (wraps `web_sys`).
* Added ability to request a repaint
* Copy/cut/paste suppoert
* Copy/cut/paste support
### Changed 🔧
* Automatic repaint every second

2
crates/emath/Cargo.toml

@ -37,7 +37,7 @@ bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
## [`mint`](https://docs.rs/mint) enables interopability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = { version = "0.5.6", optional = true }
## Allow serialization using [`serde`](https://docs.rs/serde).

4
crates/epaint/Cargo.toml

@ -34,7 +34,7 @@ default = ["default_fonts"]
## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`Vertex`] to `&[u8]`.
bytemuck = ["dep:bytemuck", "emath/bytemuck", "ecolor/bytemuck"]
## [`cint`](https://docs.rs/cint) enables interopability with other color libraries.
## [`cint`](https://docs.rs/cint) enables interoperability with other color libraries.
cint = ["ecolor/cint"]
## Enable the [`hex_color`] macro.
@ -57,7 +57,7 @@ extra_debug_asserts = [
## Always enable additional checks.
extra_asserts = ["emath/extra_asserts", "ecolor/extra_asserts"]
## [`mint`](https://docs.rs/mint) enables interopability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = ["emath/mint"]
## Allow serialization using [`serde`](https://docs.rs/serde).

4
crates/epaint/src/bezier.rs

@ -813,7 +813,7 @@ mod tests {
}
#[test]
fn test_quadratic_dfferent_tolerance() {
fn test_quadratic_different_tolerance() {
let curve = QuadraticBezierShape {
points: [
Pos2 { x: 110.0, y: 170.0 },
@ -1079,7 +1079,7 @@ mod tests {
}
#[test]
fn test_quadrtic_flattening() {
fn test_quadratic_flattening() {
let curve = QuadraticBezierShape {
points: [pos2(0.0, 0.0), pos2(80.0, 200.0), pos2(100.0, 30.0)],
closed: false,

4
crates/epaint/src/mutex.rs

@ -263,7 +263,7 @@ mod rw_lock_impl {
pub fn read(&self) -> RwLockReadGuard<'_, T> {
let tid = std::thread::current().id();
// If it is write-locked, and we locked it (re-entrancy deadlock)
// If it is write-locked, and we locked it (reentrancy deadlock)
let would_deadlock =
self.lock.is_locked_exclusive() && self.holders.lock().contains_key(&tid);
assert!(
@ -291,7 +291,7 @@ mod rw_lock_impl {
pub fn write(&self) -> RwLockWriteGuard<'_, T> {
let tid = std::thread::current().id();
// If it is locked in any way, and we locked it (re-entrancy deadlock)
// If it is locked in any way, and we locked it (reentrancy deadlock)
let would_deadlock = self.lock.is_locked() && self.holders.lock().contains_key(&tid);
assert!(
!would_deadlock,

6
crates/epaint/src/shape.rs

@ -322,8 +322,8 @@ impl Shape {
bezier_shape.points[1] += delta;
bezier_shape.points[2] += delta;
}
Shape::CubicBezier(cubie_curve) => {
for p in &mut cubie_curve.points {
Shape::CubicBezier(cubic_curve) => {
for p in &mut cubic_curve.points {
*p += delta;
}
}
@ -808,7 +808,7 @@ pub struct PaintCallback {
/// `glow` backend requires that callback be an `egui_glow::CallbackFn` while the `wgpu`
/// backend requires a `egui_wgpu::CallbackFn`.
///
/// If the type cannnot be downcast to the type expected by the current backend the callback
/// If the type cannot be downcast to the type expected by the current backend the callback
/// will not be drawn.
///
/// The rendering backend is responsible for first setting the active viewport to

6
crates/epaint/src/shape_transform.rs

@ -43,9 +43,9 @@ pub fn adjust_colors(shape: &mut Shape, adjust_color: &impl Fn(&mut Color32)) {
adjust_color(&mut v.color);
}
}
Shape::QuadraticBezier(quatratic) => {
adjust_color(&mut quatratic.fill);
adjust_color(&mut quatratic.stroke.color);
Shape::QuadraticBezier(quadratic) => {
adjust_color(&mut quadratic.fill);
adjust_color(&mut quadratic.stroke.color);
}
Shape::CubicBezier(bezier) => {
adjust_color(&mut bezier.fill);

4
crates/epaint/src/tessellator.rs

@ -1219,7 +1219,7 @@ impl Tessellator {
out.append_ref(mesh);
}
/// Tessellate a line segment between the two points with the given stoken into a [`Mesh`].
/// Tessellate a line segment between the two points with the given stroke into a [`Mesh`].
///
/// * `shape`: the mesh to tessellate.
/// * `out`: triangles are appended to this.
@ -1314,7 +1314,7 @@ impl Tessellator {
rect.max = rect.max.at_most(pos2(1e7, 1e7));
if rect.width() < self.feathering {
// Very thin - approximate by a vertial line-segment:
// Very thin - approximate by a vertical line-segment:
let line = [rect.center_top(), rect.center_bottom()];
if fill != Color32::TRANSPARENT {
self.tessellate_line(line, Stroke::new(rect.width(), fill), out);

2
crates/epaint/src/textures.rs

@ -22,7 +22,7 @@ impl TextureManager {
/// The returned [`TextureId`] will be [`TextureId::Managed`], with an index
/// starting from zero and increasing with each call to [`Self::alloc`].
///
/// The first texture you allocate will be `TextureId::Managed(0) == TexureId::default()` and
/// The first texture you allocate will be `TextureId::Managed(0) == TextureId::default()` and
/// MUST have a white pixel at (0,0) ([`crate::WHITE_UV`]).
///
/// The texture is given a retain-count of `1`, requiring one call to [`Self::free`] to free it.

Loading…
Cancel
Save