1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

More newlines for improved readability (#1880)

* Add blank lines above all `fn`, `impl`, `struct`, etc
* Even newlines between docstringed struct and enum fields
* Improve some documentation
This commit is contained in:
Emil Ernerfeldt
2022-08-02 17:26:33 +02:00
committed by GitHub
parent 5d8ef5326b
commit 10788ccc92
56 changed files with 306 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ pub struct RetainedImage {
texture: Mutex<Option<egui::TextureHandle>>,
filter: TextureFilter,
}
impl RetainedImage {
pub fn from_color_image(debug_name: impl Into<String>, image: ColorImage) -> Self {
Self {

View File

@@ -4,6 +4,7 @@ use egui::{Pos2, Rect, Response, Sense, Ui};
pub(crate) enum CellSize {
/// Absolute size in points
Absolute(f32),
/// Take all available space
Remainder,
}
@@ -20,6 +21,7 @@ pub(crate) enum CellSize {
pub(crate) enum CellDirection {
/// Cells go from left to right.
Horizontal,
/// Cells go from top to bottom.
Vertical,
}
@@ -55,6 +57,7 @@ impl<'l> StripLayout<'l> {
cell_layout,
}
}
fn cell_rect(&self, width: &CellSize, height: &CellSize) -> Rect {
Rect {
min: self.cursor,

View File

@@ -3,8 +3,10 @@
pub enum Size {
/// Absolute size in points, with a given range of allowed sizes to resize within.
Absolute { initial: f32, range: (f32, f32) },
/// Relative size relative to all available space.
Relative { fraction: f32, range: (f32, f32) },
/// Multiple remainders each get the same space.
Remainder { range: (f32, f32) },
}